Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何在事件(即按钮单击)上强制在 JavaScript 代码中设置断点?
我正在使用谷歌浏览器。
是否有任何浏览器兼容性问题可能随之而来?
设置按钮单击侦听器并调用debugger;
debugger;
例子
$("#myBtn").click(function() { debugger; });
演示
http://jsfiddle.net/hBCH5/
JavaScript 调试资源