I hate Internet Explorer
Debugging JavaScript is always a problem, but even more so in IE. Things should be better in IE8 but today my focus was on IE6. The tip of the day is: when IE shows an error during loading, it will provide you with a line number. You can look for hours at the line number and not figure out what it means and where the error happened.
I found out after much puzzling that IE will show the line number where the error happened from the file. So if you load foo.js and an exception occurs on line 731, IE will tell you only the line number. You have to find out for yourself which file is the cause. Oh, and you should subtract 1 from the line number.
Why is it impossible for IE engineers to provide helpful error messages? Is it so hard to actually show the filename as well?
Tags: debugging, ie, internet explorer, javascript
March 20th, 2008 at 6:26 pm
Martijn,
What’s worse is that sometimes the line number is totally impossible to trace because it’s not from an included file, but rather refers to the line number in the constructed HTML file that is rendered, complete with included JS, as with a finished Wicket page. It’s incredibly frustrating.
But do not abandon hope. The answer to your problems is the Microsoft Script Debugger. If you have JS debugging turned on and can induce the error, the SD will pop up with the file that caused the problem and the line that caused the problem is highlighted; exactly what you need to debug the problem.
Instructions for debugging and installing can be found on the MS IE blog. As with most IE developer solutions (like the invaluable IE developer toolbar), it’s not the most stable piece of software in the world, and you may find yourself having to restart IE multiple times on occasion in order to get the script debugger to show up properly when there’s an error.
The other thing that’s stupid about it is that when script debugging is turned on, the little exclamation icon in the status bar does not show up anymore. Dumb, dumb dumb. It’s imperfect, but better than the utterly useless error message in the standard IE installation.
Hope this helps.
March 20th, 2008 at 6:36 pm
Oh, and one more thing: the MSDN documentation links in that blog post (almost 4 years old now) are broken: you’ll want to go here instead.
March 20th, 2008 at 7:07 pm
FYI - I’ve found MS Script Editor to be a big help when debugging JS issues on IE.
March 20th, 2008 at 10:25 pm
For this purpose, I use CompanionJS, which helps me a lot, here is the link: http://www.my-debugbar.com/wiki/CompanionJS/HomePage
March 21st, 2008 at 12:57 am
So true… I read one day that guys who debug javascript will have a special place in Paradise…
April 10th, 2008 at 10:54 am
Sometimes you just need to spend hours debugging IE js, but sometimes it helps to debug the error with the firebug extension for firefox… if the error also pops out in ff, that is.
June 19th, 2008 at 12:11 am
Man do I hate I.E. with a passion. So many things I could complain about.
Firefox is the truth
August 9th, 2008 at 4:59 pm
As user, I’ve considered IE as a useless crappy browser. Easy to ignore it.
Now, that I’m trying to create my own websites, I need to consider it and I really HATE it!!!
Opera and firefox always work well but when I try with “the shitty”, there’s always something wrong.
Last issue due to an incompatibility (no solutions for this, only bad workarounds) with the thumbnail retrieved in PHP by using exif_thumbnail…
I’m thinking to let the site “bad” for IE users with a warning: “if You are using a crappy browser, this page is enough good for you”
I need to write this somewhere and i’ve found this page searching “I hate IE”!!!
Thanks for having created it.
Luca
September 4th, 2008 at 3:49 pm
IE 6 (ie7 i can tolerate) has wasted so many hours of my life I have lost count and believe you me its still wasting more, its a horrible, nasty, ugly, lazy, piece of software that no belongs in the start menus of our computers and has definately over stayed its welcome on the internet!
October 4th, 2008 at 10:08 am
Luca: As for the warning: I support this! :)) It would be great if more non-commercial sites did this, I mean just stopped tuning/fixing for MSIE:
“No addEventListener? No application/xhtml+xml? No documentevaluate? Well I’m so sorry, ROFL!”