[英]How do you create breakpoints in IE Developer Tools for code that runs while loading?
So I have this web page I need to debug in IE (9). 所以我有这个网页,我需要在IE(9)中调试。 I'd like to use the Developer Tools.
我想使用开发人员工具。 I need to create a breakpoint inside code that runs while the page is loading.
我需要在页面加载时运行的代码中创建一个断点。
The problem is that even if I set a breakpoint, when I reload the page it will be erased, as this is a new context. 问题是即使我设置断点,当我重新加载页面时它也会被删除,因为这是一个新的上下文。
If said code only ran after some given action, I could create the breakpoint and only trigger the action afterwards. 如果所述代码仅在某个给定动作之后运行,我可以创建断点并且仅在之后触发该动作。 But it runs while loading, so no luck.
但它在加载时运行,所以没有运气。
The debugger;
debugger;
statement could do what I want, but it triggers the VS Debug with... dialog, in which the only option is VS. 语句可以做我想要的,但它触发VS Debug with ...对话框,其中唯一的选项是VS.
Thank you. 谢谢。
I've been doing this for quite a bit, here is the procedure I follow: 我已经做了很多,这是我遵循的程序:
debugger;
debugger;
line wherever you need it to be in your javascript code. Start Debugging
button. Start Debugging
按钮。 This will make the Dev tools aware of any breakpoints you have specified. Good luck! 祝好运!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.