2

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?

4

1 回答 1

5

转到 google chrome 开发人员工具中的脚本选项卡并将事件侦听器断点设置为change事件(或单击事件,无论他们使用什么),然后单击一个复选框。然后它将立即停止执行,您可以逐个功能手动浏览整个执行过程。

于 2011-11-28T17:45:54.893 回答