When I want to debug an event associated with an element via jQuery, I can currently do it in the following ways:
-
In Chrome, you can enable the debugger specifically for certain types of events. However, this is not useful when it is necessary to debug something in other browsers;
-
Putting a
debugger
statement in the first line of code of an event activates the debugger at that point, but it is inconvenient to do so for each event. Also, for cases where I'm debugging someone else's code, there's still the job of getting all the events - which can be dynamically linked and unlinked (unlinked / unlinked?). -
Crude power. For example, for a click event:
function debugClick (elem) { debugger; $(elem).click(); }
This last example makes me feel bad about myself.
Is there a more elegant and cross browser way of debugging the events of an element?