Question

I want use Chrome developer tool to add a break point to js function to debug it.

For example, a function "buttonAlert()" is binded to a button.

But I don't know where the code of such function, and I don't know where the code that bind the function to button.

So, how can I use the tool to find out the location of function and binding code?

Was it helpful?

Solution

It is actually possible to see event listeners in chrome. Go to the elements panel, select the element in question and click on Event Listeners on the right side.

Event Listeners panel

Sadly most of the time when jQuery is in use, you only see the part of the source of jQuery that bound the event, not the one that called jQuery.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top