문제

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?

도움이 되었습니까?

해결책

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top