I have a page with javascript that IE determines is unresponsive. Firefox works fine on this same page. How should I go about debugging this issue? I wasn't sure if Firebug's profiler would be accurate in assessing the issue?
I have a page with javascript that IE determines is unresponsive. Firefox works fine on this same page. How should I go about debugging this issue? I wasn't sure if Firebug's profiler would be accurate in assessing the issue?
Share Improve this question asked Feb 19, 2011 at 19:59 stevebotstevebot 24k35 gold badges131 silver badges184 bronze badges 3- 1 Any chance to explain what is this javascript doing? Ideally provide some sample snippets? – Darin Dimitrov Commented Feb 19, 2011 at 20:01
- 1 that is part of the problem. There are many javascript on the page, and IE doesn't report which one is causing issues. – stevebot Commented Feb 19, 2011 at 20:03
- yeah, kinda difficult to help under those circumstances. Maybe you should try narrowing down the problem by excluding parts of your code which is the first thing developers do when they encounter some problem: narrow it down. – Darin Dimitrov Commented Feb 19, 2011 at 20:06
3 Answers
Reset to default 2IE8 also has a debugger you can use; just press F12 and start stepping through it. You can also add logging statements with console.log
which you can see IE's console output. Once you find the JS that is long running, you can break it up with setTimeout
calls.
This KB article explains how the long running script timer works: http://support.microsoft./kb/175500
Internet Explorer now tracks the total number of executed script statements and resets the value each time that a new script execution is started, such as from a timeout or from an event handler, for the current page with the script engine. Internet Explorer displays a "long-running script" dialog box when that value is over a threshold amount. Internet Explorer doesn’t check on each instruction to see if it is over the limit. Periodically the script engine polls Internet Explorer with the number of statements executed and Internet Explorer checks if that is over the limit.
Note that the fix described in the article is simply specific to your local machine and will not fix your code for other users (that is, it tells you how to change your registry setting to lengthen the timer... this is not useful for you).
Try using this free tool for profiling JavaScript in IE: http://ajax.dynatrace./ajax/en/
It was reviewed by John Resig: http://ejohn/blog/deep-tracing-of-internet-explorer/
It has overwhelming set of features. I wish Firebug was so detailed.
If you are using IE, then you can use the built-in profiler. Hit F12 to open the Developer Toolbar, and on the Script tab, there is a button that allows you to profile just like in Firebug. You can also click on the Start Debugging button to step through your code and find where the errors are occurring.
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1742342514a4425911.html
评论列表(0条)