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

internet explorer - How to make JavaScript break into IE built-in debugger (F12) rather than Visual Studio debugger? - Stack Ove

programmeradmin4浏览0评论

I often use this to debug JavaScript in IE (fiddle):

if (confirm("Debug from here?"))
    debugger;

If I choose "yes", I see the prompt to start Visual Studio just-in-time debugger, which I proceed with to debug the script in Visual Studio.

Now I want to use IE built-in debugger instead of Visual Studio. I use this workaround:

if (confirm("Debug from here?"))
    throw "debug";

It works, but I have to check "Continue after exception" in IE built-in debugger every time I hit throw. Also, throw is different from debugger (which just continues execution if debugging is disabled in IE options).

Is there a way to make debugger keyword to break into into IE built-in debugger (F12) rather than Visual Studio debugger?

Setting breakpoints in IE F12 tools, then refreshing the page with F5 is not an option, because the page is a postback.

EDITED. Chrome browser actually gives me the desired behavior. To see what I mean, open Chrome, hit F12 to open Dev tools, then navigate to . Click [OK] upon confirm and you should get into debugger right on the debugger line.

I often use this to debug JavaScript in IE (fiddle):

if (confirm("Debug from here?"))
    debugger;

If I choose "yes", I see the prompt to start Visual Studio just-in-time debugger, which I proceed with to debug the script in Visual Studio.

Now I want to use IE built-in debugger instead of Visual Studio. I use this workaround:

if (confirm("Debug from here?"))
    throw "debug";

It works, but I have to check "Continue after exception" in IE built-in debugger every time I hit throw. Also, throw is different from debugger (which just continues execution if debugging is disabled in IE options).

Is there a way to make debugger keyword to break into into IE built-in debugger (F12) rather than Visual Studio debugger?

Setting breakpoints in IE F12 tools, then refreshing the page with F5 is not an option, because the page is a postback.

EDITED. Chrome browser actually gives me the desired behavior. To see what I mean, open Chrome, hit F12 to open Dev tools, then navigate to http://jsfiddle/jTwsh. Click [OK] upon confirm and you should get into debugger right on the debugger line.

Share Improve this question edited Apr 23, 2014 at 22:24 Kara 6,22616 gold badges53 silver badges58 bronze badges asked Oct 18, 2013 at 4:15 avoavo 10.8k13 gold badges58 silver badges88 bronze badges
Add a ment  | 

2 Answers 2

Reset to default 3 +50

Suggest to disable the Just-In-Time debugger for Script; if you do not want to use it for.

See the below reference on how to enable/disable JIT Debugger:

Enable/Disable Just-In-Time Debugging

I am using IE8, there i need to start the script debugging by pressing 'Start Debugging' button or F5 under 'Script' tab in Developer Tools.

See the attached screenshot:

Don't run the website in debug. It is possible to run website in 'normal' runtime:

Right-Click on any page => View in browser

or ctrl+f5

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论