Debug JavaScript in IE

Aug

01

I ALWAYS use Firefox to debug my JavaScript code. There are plenty of plugins that allow for you to easily debug problems in your code. But what about when your code runs perfectly fine in Firefox, but not in IE? How do you debug your JavaScript code in IE? I've finally found the answer:

Step 1 - Enable script debugging.

Now the process for doing this is obvious. Go to "Tools -> Internet Options... -> Advanced". From here, find "Disable Script Debugging (Internet Explorer)", and "Disable Script Debugging (Other)". Now, follow me here... To enable script debugging, you need to uncheck these boxes. Very intuitive, I know. Once you've unchecked these two boxes, click "OK".

Step 2 - Open up your debugger.

To access your debugger, run your script (i.e. reload your html page, and trigger the JavaScript). A new pop-up message should appear.

IE runtime error

Click Yes. Doing so, will bring up another window.

Just-In-Time Debugging

There are three applications available for script debugging: "Visual Studio.Net", "Microsoft Script Debugger" and "Microsoft Script Editor". You may be limited in your choices, however (see image). Choose the debugger from the list, and click Yes. This will bring up the debugger, which will most likely take you to the line of code that is causing the problems.

Debugger tool

There you have it. A way to debug JavaScript in IE.

Hints and Other Articles

Hopefully this helps take away some of the pain that is Internet Explorer.

No CommentsComments

Leave a Comment