如何在IE Developer Tools中为加载时运行的代码创建断点? [英] How do you create breakpoints in IE Developer Tools for code that runs while loading?

查看:102
本文介绍了如何在IE Developer Tools中为加载时运行的代码创建断点?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以我有这个网页我需要在IE(9)调试。我想使用开发工具。我需要在页面加载时运行的代码中创建一个断点。

So I have this web page I need to debug in 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.

调试器; 语句可以做我想要的,但它触发VS调试与...对话框,其中唯一的选项是VS。

The debugger; statement could do what I want, but it triggers the VS Debug with... dialog, in which the only option is VS.

谢谢。

推荐答案

我已经做了很多,这里是我遵循的程序:

I've been doing this for quite a bit, here is the procedure I follow:


  1. 将您的调试器; 行,无论您需要它在
    JavaScript代码中。

  2. 打开IE和 BEFORE 加载您的页面,然后按F12键
    启动工具

  3. 在开发工具中,单击脚本选项卡,然后按开始
    调试
    按钮。这将使开发工具知道您指定的任何
    断点。

  4. 加载您的网页,开发工具应该选择
    调试器语句。 li>
  1. Put your debugger; line wherever you need it to be in your javascript code.
  2. Open up IE and BEFORE loading your page and press F12 to bring up the Dev Tools
  3. In the Dev Tools, click on the Script tab and press the Start Debugging button. This will make the Dev tools aware of any breakpoints you have specified.
  4. Load up your webpage and the Dev Tool should pick up the debugger statement.

祝你好运!

这篇关于如何在IE Developer Tools中为加载时运行的代码创建断点?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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