以编程方式停止Firebug中的JavaScript执行

时间:2009-08-12 11:35:56

标签: javascript debugging firebug breakpoints

我目前正在使用Firebug调试复杂的JavaScript代码。我正在寻找一种方法来停止JavaScript执行,就好像它是一个以编程方式为断点。

示例:

instructions ...
degugger.breakpoint(); // the execution stops here as if a breakpoint was
                       // manually set
other instructions ...

1 个答案:

答案 0 :(得分:115)

您可以使用debugger声明:

// your JS code
...
// break here
debugger;

适用于所有主流浏览器。

相关问题