David
David

Reputation: 16120

How to find JavaScript run when an event is hooked up unobtrusively

I am working on a web page that contains check boxes that do some stuff when they are clicked, or changed. There is no explicit event binding in the HTML itself. I have literally no idea how the event binding has been done and no way to find what JavaScript is being run when the checkboxes are changed (other than the page uses jQuery in other places).

The JavaScript itself is spread out in several locations in the HTML itself, plus in a whole bunch of additional JavaScript files. This would make just sticking breakpoints everywhere in the JavaScript difficult.

Is there any way, using some debugging environment for example, to find out what JavaScript is run when I change the values of these checkboxes?

Upvotes: 2

Views: 574

Answers (1)

Esailija
Esailija

Reputation: 140210

Go to scripts tab in google chrome developer tools and set an Event Listener Breakpoint to a change event (or click event, whatever they are using) and go click a checkbox. It will then stop execution right away and you may manually walk through the whole execution process, function by function.

Upvotes: 5

Related Questions