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.
我目前正在使用 Firebug 调试复杂的 JavaScript 代码。我正在寻找一种方法来停止 JavaScript 执行,就好像它是以编程方式设置断点一样。
例子:
instructions ... degugger.breakpoint(); // the execution stops here as if a breakpoint was // manually set other instructions ...
您可以使用以下debugger语句:
debugger
// your JS code ... // break here debugger;
它适用于所有主流浏览器。