I’m going to keep this short because I’ve been extremely productive today and want to continue this trend for a couple more hours.

I would like to start by saying that I heart Firefox. And probably Joe Hewitt as well, but for developing Firebug.

I love JavaScript development. Although JavaScript may seem very ‘laxed, its prototypically inheritance and DOM manipulation is fantastic! But this post isn’t about that. It’s about what to do when you switch browsers, hold your breath, and try to see what IE spits out.

If you have Office 2003 then you have the Microsoft Script Editor. I read that all over the web, but I tried searching for “mse.exe” and nada. After losing some hair I found it!

You can install it through MS Word. So open it up and follow the image below. Just click on the Script Editor and it will begin installing.

Then, you’ll want to un-disable script debugging. The option is found here: Tools > Internet Options > Advanced > Disable script debugging (Internet Explorer).

A lightweight debugger

Before making this find I took a few minutes to write a quick logger/debugger that works in both FireFox and IE (not tested elsewhere, but *should* work). =)

There are some powerful loggers out there, like YUI Logger, but it was easier for me to crank this out than spend some time reading APIs and other doc.

Here’s my lightweight, ~4K debugger. Debug.js. Just include the file above where you call the debugger. The call looks like this:

DEBUG.debug('a debug message');
DEBUG.warn('a warn message');
DEBUG.error('an error message');

Quick review of other IE debuggers

Added: May 12, 2008

DebugBar

    Pros:

  • Can view DOM
  • Displays more information during script error than IE w/o toolbar
  • Built-in HTML validator
  • Built-in JavaScript console
  • Cons:

  • DOM changes in toolbar do not refresh in IE7
  • Cannot set breakpoints and step through code
  • Debug errors have correct line number, but URL is not always accurate (if I have a page, index.html, and include a script, test.js, with errors the error message says index.html has an error)

IE Developer Toolbar

    Pros:

  • Can view DOM
  • Can view all HTML properties (like the random ‘htmlFor’ which is IE’s label property for the ‘for’ attribute)
  • Cons:

  • Not a debugger (so it won’t display scripting errors)
  • DOM changes in toolbar do not refresh in IE7
  • Cannot set breakpoints and step through code

My vote is for the DebugBar, although it would be great to have the ability to step through code and have more accurate scripting error messages in the future.