最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - How do you create breakpoints in IE Developer Tools for code that runs while loading? - Stack Overflow

programmeradmin8浏览0评论

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.

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

Thank you.

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.

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

Thank you.

Share Improve this question asked Aug 3, 2011 at 18:29 entonioentonio 2,1732 gold badges19 silver badges28 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 15

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

  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.

Good luck!

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论