views:

1332

answers:

3

I have a collection of extjs objects on a webpage, developing using Firefox so I can debug using Firebug. After a while I start IE to check compatibility and get a blank page in IE, but all works in FF.

In IE I get no Javascript errors.

+2  A: 

In the Firebug options turn on "Strict Warnings" then look for a warning in the .js source file for your page. It seems that Firefox is much more forgiving of a comma after the last member of a collection. Look for warning labeled "trailing comma is not legal in ECMA-262 object initializers". This pinpointed the problem.

This is one good thing about Netbeans, which I use for PHP. If in my Javascript I put a comma at the end of a list or object it gives me a warning that IE doesn't like it. Otherwise I probably wouldn't have known.
cletus
A: 

jslint.com helps a lot with IE JavaScript problems. It's too easy to have a hanging comma that FF ignores and IE chokes on.

Allan
+1  A: 

'It seems that Firefox is much more forgiving of a comma after the last member of a collection.'

Yeah!! thats it. In addition to jslint theres is also http://www.jsonlint.com/ available.

thorsten