Development Projects

WordPress Plugins

Categories

Blogroll

Buy Me a Beer

Have you found these plugins or this site useful? Programmers need fuel.
$

Debugging Javascript in IE Without Visual Studios

By wfrench | February 24, 2008

Go figure that Firefox, with the help of Firebug would make it easy to debug javascript for your web applications. However, if you are writing production caliber web applications you MUST ensure it works with Internet Explorer as well. Whether we like it or not, IE still has the numbers.

Unfortunately, debugging Javascript issues on IE is a pain in the rear because you really get NO useful debugging information by default. “Error on line 38 Character 1″ isn’t really useful if you have 10 files include on your page. What I would like is a full fledge Javascript debugger with step through, breakpoints, watches, and relevant error message. So how can we more effectively debug Javascript?

My Solution

I’ve haven’t done an exhaustive search or tried too many solutions, but I found the one that worked for me. While I would like a full fledge debugger, the #1 requirement was useful error messages. Some of the options I found through with a little Google-fu where Visual Studios, MS Script Debugger and a couple of IE plugins. Another complication is that I’m using Windows Vista with IE 7 and it seemed most of the posted solutions were geared towards IE 6 running on Windows XP.

My final solution was to install an IE plugin, Companion.JS. Companion.JS is great because it provided me with a source file and line number that was causing the error. With that I was able to properly fix JS bugs in IE. Now I do my primary development in Firefox, then just test IE.

Companion.JS Setup

1. Get the installers

Companion.JS required Microsoft Script Debugger, so you will need to download both.

2. Install the Packages

You will need to close all instances of IE before you install. To install just double click on the downloaded files. First MS Script Debugger, then Companion.JS

3. Enable Script Debugging

In order to use the debugger you must enable script debugging in the internet options. Open Internet Explorer and open the Tools->Internet Options menu. Click the Advanced and ensure that Disable Script Debugging (Internet Explorer) is not checked.



4. Restart Internet Explorer
Now restart IE and you are all set. Companion.JS will now report your IE Javascript errors.Happy Scripting …

Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google

Topics: Development, Howto, Javascript |

Comments