Chomper Stomping
jQuery/JavaScript/CSS 3/HTML 5, Java/PHP/Python/ActionScript, Git, Chrome/Firefox Extensions, Wordpress/Game/iPhone App Development and other random techie tidbits I've collected



programming concepts

December 17, 2007

Debugging Javascript in IE

More articles by »
Written by: Christopher McCulloh

Trying to debug javascript (or even write a web-page) using IE is enough to bring a grown man weeping for a merciful swift death on his knees. Or at least enough to drive you to take frequent breaks, drink multiple cups of coffee, and play with relaxing meditative toys (like the rubiks cube, or a stress ball, or a jacobs ladder, etc). I’m sure this guy was probably debugging javascript, although it was probably back during the first Netscape/IE browser wars:

I am currently working on one AJAX enabled web page with 500 lines of javascript (and that’s using jQuery to exponentially simplify it, and I’m only 1/3 of the way done too). So I finally decided to fire up my beautifully working script in IE after working for a few days in FF.

Done, but with errors on page.

Oh crap. My javascript is all extracted out into included script files (five of them) so all it does is give me the line number on the main page that is calling the file with the error. The file with the error is 150 line of javascript that works perfectly in FF. That’s all the information I am given.

When I get an error in firefox, it tells me the exact line number in the exact file that is giving me trouble. I can normally fix the error in about 2 minutes at the most. I spent the last 30 minutes on this one.

The problem was that I had mistakenly named a variable “class” which I’m sure those of you who are still reading at this point know is a reserved word. I simply renamed it “theClass” and moved on. But why did IE fail me so miserably when I failed it, and how can we work together better in the future?

Well, to begin with, the way I finally found the error was to type in the exact URL to the Javascript file that was giving me the error in the first place. It failed to open because of the error, but mercifully told me what line number in that file was giving it the error (took me 3 seconds to realize what was wrong and another 2 to fix it after that).

There had to be another way though, so I went in search of a javascript debugger on Yahoo (ha ha, just kidding, who uses Yahoo anymore? I went to Google). I came upon this blog post which pointed me to this Microsoft page which after giving me a thorough cavity search to make sure I wasn’t a theif using a stolen copy of their precious software (which seems to have become as standard as shaking hands for M$) let me download their software.

I install the script debugger (on Vista) and pop open IE…. nothing. It freezes. The browser doesn’t even start properly. I have to kill it and try again. Still nothing. I restart. Nothing. I uninstall and redownload THREE TIMES, run a virus scan, uninstall all other addons and toolbars, and two hours later Still NOTHING. #$&! #*&@!# *$ $#!+!!!!!!!!!!

This scene of office space came to mind at this point:

http://www.youtube.com/watch?v=T6syezOHJ2Q

If only someone had stolen Bill Gates original computer and done this to it the weekend he decided to steal BASIC and mod it and start selling it…

Haha. I don’t really hate Microsoft that much. I mean, I’m sure I would feel the same way sometimes if I were on a Mac, or using Linux… right? right?

So I still haven’t really “solved” my javascript debugging needs. At least I have a crappy work around…



About the Author

Christopher McCulloh
E-Commerce developer at Finish Line Co-Author of HTML, XHTML and CSS All-in-one Desk Reference for Dummies Graduated from IU with a Bachelors of Media Arts and Science and a Certificate in Applied Computer Science. Tech Editor for Building Facebook Applications for Dummies and Building Websites All-in-one for Dummies 2nd Edition. Creator and maintainer of the Status-bar Calculator Firefox Extension Three years professional experience in Java E-Commerce Development and four years professional experience with PHP for a combined total of seven years professional JavaScript/HTML/CSS experience




 
 

 
Screen Shot 2012-05-02 at 10.23.54 AM

Douglas Crockford – JavaScript the Good Parts

Really good lecture on JavaScript, especially if you are new to the language from another language like Java.
by Christopher McCulloh
0

 
 
cloudwars

Let the Cloud Wars Begin!!!

This is all going the same direction. They are all going to end up with unlimited storage for the same price point per year, so, the sooner one of them calls it and just offers that, the better that one will do. They need to ju...
by Christopher McCulloh
0

 
 
logo

dynode Batch Get Item

Working a lot with node.js, dynode and dynamoDB recently. Still trying to wrap my head around it all. Had a horrible time getting dynode.batchGetItem to work. Here is the error I was getting: { name: 'AmazonError', type: 'Valid...
by Christopher McCulloh
0

 

 
mysqlerror

WP phpBB Bridge: Warning: mysql_set_charset() expects parameter 2 to be resource, boolean given

Warning: mysql_set_charset() expects parameter 2 to be resource, boolean given in wp-content/plugins/wp-phpbb-bridge/inc/widgets/wpbb_topics_widget.php on line 149 This is an error caused by the fact that the WP phpBB Bridge pl...
by Christopher McCulloh
0

 
 
 

Events Calendar Pro Nav Formatting Messed up on Empty Calendar

The Events Calendar Pro (from http://tri.be/) has a few problems. If you are trying to figure out why a calendar with no events in that month has completely screwed up header navigation, just put this line of code inside of tab...
by Christopher McCulloh
5

 




0 Comments


Be the first to comment!


Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>