Howto Debug JavaScript on Internet Explorer

First things first: I’m a Firefox evangelist. The problem is: people do use IE.  There’s nothing we can do about that – even if we convert everyone to a browser (a real one, I mean), today, at this right moment, most people use Internet Explorer.

So you face a deal: your javascript is working perfectly on Firefox, but problems arise on IE. What should we do? The only message you get from the “browser” are things like “Unknown Error on Unknown Line”. Perfect, right?

Normally, you would fill the code with alerts like “Got into the loop”, “i = 10” etc. It works, most of the time, but if, say, your loop iterates 100 times it’s quite annoying.  Well, googling around a bit, I found 3 ways to help you out. (1) Microsoft Script Editor, (2) Microsoft Script Debugger, (3) Javascript Debug Window.

The first one comes bundled with MS Office 2003. Since I cannot afford (and wouldn’t, even if I could)  a copy of a software that costs more than the computer it runs in, and at work we use Office 2000, I could not test it.

The second one, is avaiable for download here, and works fairly well. There’s a big problem, though: It only worked for me when running as Administrator of the machine. Well, running IExplorer is already a security issue, running it as Administrator is like asking to be hacked.

So, it left us with using a debug window.  It opens a window that will output the text you send to it through the new debug() function. Just place the code on your page and you should be OK. I took this tip from Isocra website, all credits go to people there!

~ by Dante Regis on February 24, 2007.

One Response to “Howto Debug JavaScript on Internet Explorer”

  1. Or you can use Visual Web Developer. Here is a good article on how to set it up.

    http://www.berniecode.com/blog/2007/03/08/how-to-debug-javascript-with-visual-web-developer-express/

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: