views:

844

answers:

8

What's the best way to debug Javascript on IE ?

+7  A: 

Depends on what tools you have available to you.

If you have a copy of Visual Studio, I'd use the Visual Studio debugger. It works pretty well. You'll need to try following the instructions in that link if you don't have a full copy of Visual Studio, otherwise it's built in to the IDE and is pretty simple to use.

Another option is Firebug Lite, which is pretty good for most situations, but you need to add a script reference to every page you want to debug in order for it to work.

Dan Herbert
+2  A: 

I try to run the same code in Firefox to see if Firebug will be any help. But, with IE specific errors, this obviously doesn't work.

You could always fall back on alert statements peppered throughout your suspect code. It's not pretty or easy, though.

The VS debugger is usually decent, but things like Firebug Lite never worked well for me.

EndangeredMassa
+2  A: 

Using Microsoft Script Editor is an option too: See my answer here.

John Nolan
A: 

Use MS Visual Studio (free) to debug JS, explained here: http://www.berniecode.com/blog/2007/03/08/how-to-debug-javascript-with-visual-web-developer-express/

powtac
A: 

I tend to use a mix of blackbird, Companion.JS and Microsoft Script Editor.

bchhun
A: 
x-yuri
A: 

I have been using IE8 beta with its built in debugger for a few months now. It is very powerful and works well. It has a few trivial glitches, but is the best tool I have used so far for client side debugging.

http://www.microsoft.com/windows/Internet-explorer/beta/default.aspx

It's a big commitment to install the IE8 beta, though.

Ishmael