简体   繁体   English

如何在IE Developer Tools中为加载时运行的代码创建断点?

[英]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: 我已经做了很多,这是我遵循的程序:

  1. Put your debugger; 放你的debugger; line wherever you need it to be in your javascript code. 无论你需要它在你的JavaScript代码中的哪一行。
  2. Open up IE and BEFORE loading your page and press F12 to bring up the Dev Tools 打开IE并加载页面之前按F12打开Dev Tools
  3. In the Dev Tools, click on the Script tab and press the Start Debugging button. 在Dev Tools中,单击Script选项卡,然后按Start Debugging按钮。 This will make the Dev tools aware of any breakpoints you have specified. 这将使Dev工具知道您指定的任何断点。
  4. Load up your webpage and the Dev Tool should pick up the debugger statement. 加载您的网页,开发工具应该拿起调试器语句。

Good luck! 祝好运!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 IE Developer Tools断点不起作用 - IE Developer Tools breakpoints are not working 如何在Chrome开发人员工具中的每一行上不设置断点的情况下,逐行浏览JavaScript代码? - How do I step through JavaScript code line by line without placing breakpoints on each line in Chrome developer tools? Firefox开发人员工具中的XHR断点 - XHR Breakpoints in Firefox developer tools 如何强制开发人员工具在IE中打开 - How to force developer tools to open in IE 在我打开Developer工具之前,IE没有加载XML内容? - IE not loading XML content until I open Developer tools? 了解IE11 F12 Developer工具中无法访问的断点 - Understanding unreachable breakpoints in IE11 F12 Developer tools 如何在IE8的开发人员工具中查看JavaScript对象? - How do I view an JavaScript object in IE8's Developer Tools? Chrome开发人员工具之外的CSS断点的死区 - Deadzone for CSS breakpoints outside of Chrome Developer Tools 如何在开发者模式下创建 Squarespace 表单块? - How do you create a Squarespace form block in Developer Mode? 内容编辑器Web部件脚本不在IE 11中运行(如果开发人员工具处于打开状态,则运行) - Content editor webpart script does not run in IE 11 (runs if developer tools are open)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM