在Firebug中以编程方式停止JavaScript执行 [英] Programmatically stop JavaScript execution in Firebug

查看:165
本文介绍了在Firebug中以编程方式停止JavaScript执行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在使用Firebug调试复杂的JavaScript代码。我正在寻找一种方法来阻止JavaScript的执行,就像它是一个断点一样。



示例:

 说明... 
degugger.breakpoint(); //执行停止在这里,好像断点是
//手动设置
其他指令...


解决方案

您可以使用 调试器 声明:

  //你的JS代码
...
// break here
debugger;

它适用于所有主流浏览器。


I am currently debugging complex JavaScript code with Firebug. I am looking for a way to stop the JavaScript execution as if it was a breakpoint programmatically.

Example:

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

解决方案

You can use the debugger statement:

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

It works in all major browsers.

这篇关于在Firebug中以编程方式停止JavaScript执行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆