4
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 of no use when it is necessary to debug something in other browsers;
place an instruction
debugger
in the first line of code of an active event the debugger at that point, but it is inconvenient to do so for each event. Also, for cases where I will debug someone else’s code, there is still the work of getting all the events - which can be associated and disfellowshipped (tied/untied?) dynamically.Brute force. For example, for a click event:
function debugClick (elem) { debugger; $(elem).click(); }
This last example makes me feel bad about myself.
Is there any more elegant and cross browser to debug the events of an element?
I like that answer, but it’s exactly what I mentioned as the first of my alternatives (
"no Chrome, é possível ativar o depurador especificamente para certos tipos de eventos"
). Even so, +1 to elaborate on how to do this, to serve as reference for those who read the question.– Oralista de Sistemas