IE, objects, and commas

Using objects with javascript, under IE requires attention to commas.

If you have an AJAX application that won’t load, and the error message is difficult to match up with the code, or not descriptive, one of the best things to check is the objects for trailing commas.

The code below will run fine in FF, but will not load in IE, because of the trailing comma after the second object in the array.


object={"object":"value","array":[{"v":"one"},{"v":"two"},]};

Be sure to check any JSON data sent back from the server, as well as that which is assigned or dynamically generated in javascript.

Brute force debugging with alert statements may be helpful.