10

What's the best way to debug Javascript on Internet Explorer?

Purag
  • 16,941
  • 4
  • 54
  • 75
perrohunter
  • 3,454
  • 8
  • 39
  • 55
  • 1
    Here is a very similar question http://stackoverflow.com/questions/361635/debugging-javascript-in-ie7 – Bob Jan 11 '09 at 22:42

8 Answers8

9

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
  • 99,428
  • 48
  • 189
  • 219
3

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

Community
  • 1
  • 1
Johnno Nolan
  • 29,228
  • 19
  • 111
  • 160
2

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
  • 17,208
  • 8
  • 55
  • 79
0

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
  • 40,542
  • 28
  • 115
  • 170
0

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

bchhun
  • 18,116
  • 8
  • 28
  • 31
0

I have got to say, that Firebug is unstable for my current project, maybe because I use jQuery. But it is the best because of his interface and feature list. As to stability, I have no claims on Microsoft Script Editor. But it's useless for cases, when script has syntax errors

As to Visual Studio's debugger, I didn't try that one

By the way, Firebug lite can be used through bookmarklet (http://remysharp.com/2007/03/13/firebug-in-ie-for-any-web-site/). So there is no need "to add a script reference to every page you want to debug in order for it to work"

x-yuri
  • 16,722
  • 15
  • 114
  • 161
  • 3
    Maybe this will help somebody. I've been using Splinetech Javascript Debugger (http://www.javascript-debugger.com) for years to debug JavaScript and Jquery for IE. Not free but was worth it for me though. –  Oct 17 '12 at 03:35
0

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
  • 30,970
  • 4
  • 37
  • 49