How to launch IE8 debugger with debugger; command

a 夏天 提交于 2019-12-24 06:29:44

问题


The javascript command 'debugger;' will start a debugger.

 debugger;

But (with Visual Studio 2008 installed) I cannot seem to figure out how to get this to break into the IE8 debugger. It will give me a list of choices such as VS2008, VS2010, Microsoft Script debugger.

If I do the following it will break into the (lightning fast) VS2008 debugger...

 throw Error("d");

... but I want to get it to do so when I use the 'debugger;' command. How can I do this


回答1:


Step 1: Open the page you want to debugger
Step 2: Open IE8 Debugger and click Script -> Start Debugging
Step 3: Then It will break into the IE8 debugging while execute the code.

Hope it helps!




回答2:


If you need to jump into the debugger before you have access to the Start Debugging command, such as in an onLoad handler, you can use any illegal instruction to pop into the IE8 debugger, such as:

null.length;


来源:https://stackoverflow.com/questions/1218212/how-to-launch-ie8-debugger-with-debugger-command

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!