6 December 2006
Debugging JavaScript
In the hey-day of Internet Explorer 5 and Office 2000, there was a nice application called Microsoft Script Debugger. In place of the Error on Line 188 statuses Internet Explorer would give you, it would drop you into a debugger which held remote control over Internet Explorer as you stepped through the code, watched variables, and under certain circumstances, even induced new code. It wasn’t terribly long into 2002 that I lost control of my computer to an IE exploit and left for the Mozilla universe, and with it, lost Microsoft Script Debugger.
Never during its peak did Mozilla overtake Internet Explorer in functionality. But Firefox, with its wealth of extensions, eventually did. The excellent Web Developer Toolbar, and built-in DOM Inspector offered compelling features over Internet Explorer. Developing and debugging HTML and CSS, and to a lesser extent, the JavaScript DOM had greatly improved. But an actual equivalent to Microsoft Script Debugger never materialized.
Enter FireBug. It’s a snap-in extension to FireFox to manage and debug JavaScript. It has other features as well, some of which overlap with Web Developer Toolbar, but its JavaScript debugging is the killer feature. It allows conventional Run/Step-in/Step-over/Step-out control, conditional breakpoints and variable watches. It’s not perfect, frequently incomplete and buggy. It’s not as good as MSD was five years ago. But it’s put the state of JavaScript debugging in Mozilla in a far better place than it was even weeks ago.


Before FireBug came out, I used Venkman for some basic javascript debugging. It may be more mature than FireBug. It is also a free firefox plug-in, but it started as a mozilla project and is 5 years old. It’s been a while since I used it but I remember it being a decent product.