JS Error: "Expected identifier, string or number" but only on Internet Explorer

I got some cryptic errors on Internet Explorer when the document was trying to load. Took me a few hours to hunt this bastard down!

image

Hmm ok, so I took a look at line 269 of the HTML and it had nothing. At first I thought it was a JQuery bug. Nope it wasn't.

After taking a look at the error details, I got this:

image
Err, wtf?

Bloody hell! Does it hurt to be a little more descriptive?

After enabling the script debugger (instructions), I found that the errors were caused by defining objects with a trailing comma at the end of the last field.

image
A snippet of the "ajaxupload_3_6.js"

Removing the "," at the end of the "onError" line would fix the issues. Seems that IE has an issue parsing it and decides to stop executing scripts on the page altogether.

 
Copyright © Twig's Tech Tips
Theme by BloggerThemes & TopWPThemes Sponsored by iBlogtoBlog