Internet Explorer Doesn't Like Your Trailing Commas
Thu, 11/19/2009 - 01:42 — Mark

I just got bit by a strange bug that I haven't encountered before and wanted to share the 5 minute solution with everyone so they don't spend the hour I did trying to install Visual Web Developer Lite in a virtual machine to debug IE's Javascript wackiness.
Firefox could care less if you write your code like this:
address: {
required: true,
minlength: 2,
},
city: {
required: true,
minlength: 2,
},
state: {
required: true,
},
But apparently IE blindly chokes unless you write it like this:
address: {
required: true,
minlength: 2
},
city: {
required: true,
minlength: 2
},
state: {
required: true
},
Notice all the trailing commas removed, even from one line items. Not sure who is implementing the spec correctly here, but sure makes for a thorny problem when the best tool for JS debugging is Firebug in Firefox and therefore most initial development is done in Firefox.
Comments
Post new comment