How to trace or debug all available javascript events

前端 未结 4 1273
你的背包
你的背包 2020-12-04 12:26

How can I trace all Javascript events of a web page?

Is there a possibility to trace all events, even such without a handler attached?

Is there any tool out th

相关标签:
4条回答
  • 2020-12-04 12:42

    Here is a list of Javascript events: https://developer.mozilla.org/en-US/docs/Web/Events

    0 讨论(0)
  • 2020-12-04 12:42

    You can use FireBug Profiling Tool on FF and Web Developer Tool on IE8 or Developer Tools on WebKit

    EDIT:

    Just curious though, what do want to do with those events?

    0 讨论(0)
  • 2020-12-04 12:59

    This is my favorite reference, it is updated more frequently than some of the other posts: https://developer.mozilla.org/en-US/docs/Mozilla_event_reference?redirectlocale=en-US&redirectslug=DOM%2FDOM_event_reference

    0 讨论(0)
  • 2020-12-04 13:08

    Here's a simple script to log all available events in the browser's console:

    var ev = '',
        out = [];
    for (ev in window) {
        if (/^on/.test(ev)) { 
            out[out.length] = ev;
        }
    }
    console.log(out.join(', '));
    

    Of course you'll get only the events of the browser you're currently using.

    0 讨论(0)
提交回复
热议问题