Impossible Javascript Error

pr0gr4mm3r's picture

He has: 1,502 posts

Joined: Sep 2006

I hate Javascript. Mostly because it's such a pain to debug. I have a page, that loads perfectly fine in FF, but IE is throwing an error. I usually use FF to help me debug JS errors, but it can't help me in this case. The attached image will show why I am at a loss as to see what is causing the problem. What do you use to troubleshoot Javascript errors in MSIE only?

AttachmentSize
js_error.jpg157.77 KB
greg's picture

He has: 1,581 posts

Joined: Nov 2005

I have only ever used JS a few times, and even then it was simply a case of copy/paste as I don't know much about the language, so cannot help you with the debugging.

But for IE debugging in general I often use Firebug Lite which is basically Firebug that works in all browsers.

It's not perfect, and in some ways not as good as Firebug, but it helps in some debugging.
As I don't really use JS I don't know how well the JS debugging side is, but according to their site it looks informative.

teammatt3's picture

He has: 2,102 posts

Joined: Sep 2003

Can you use the uncompressed mootools JS library instead? The IE script debugger is complaining about something in there (I think).

I have IE 6. To enable debugging, go Tools > Internet Options > Advanced > Uncheck Disable Script Debugging. The debugger will come up in Visual Studio, or the built in VB editor (if you have MS Office).

decibel.places's picture

He has: 1,494 posts

Joined: Jun 2008

the line number may be the line in an included script, or the line in the doc with the script inserted

I love JS because of all the nifty things it does

as with any code, write it clean and you will have fewer errors

page loads without error in IE7

have you had a look at the Firefox error console?

pr0gr4mm3r's picture

He has: 1,502 posts

Joined: Sep 2006

page loads without error in IE7

Wait for the webcam image gallery to load. There is an AJAX call that loads that section separately because sometimes the API calls to wunderground.com is slow. This way, the rest of the page is shown to you quicker, and usually, that section loads before you get that far down on the page. It makes that call and then sets a div.innerHTML to the returned HTML from a URL like http://chasingweather.com/forecast/webcams/41.3969/-87.3274. I'm pretty sure this is why the line numbers is off, but it still doesn't help me solve the problem.

decibel.places's picture

He has: 1,494 posts

Joined: Jun 2008

perhaps it is your DOCTYPE strict XHTML? just a hunch...

He has: 629 posts

Joined: May 2007

Don't have a solution, but a couple of suggestions that might help:

Companion JS

Firebug Lite

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.