如何在Chrome中通过代码设置JavaScript断点? [英] How to set a JavaScript breakpoint from code in Chrome?
本文介绍了如何在Chrome中通过代码设置JavaScript断点?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想迫使Chrome调试器通过代码断行,或者使用某种注释标记,如 console.break() code>。
I want to force the Chrome debugger to break on a line via code, or else using some sort of comment tag such as something like console.break()
.
推荐答案
您可以使用调试器;
你的代码。如果开发者控制台处于打开状态,则执行会中断。它也适用于萤火虫。
You can use debugger;
within your code. If the developer console is open, execution will break. It works in firebug as well.
这篇关于如何在Chrome中通过代码设置JavaScript断点?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文