Biggest Internet Explorer Problem With Javascript
By Angsuman Chakraborty, Gaea News NetworkThursday, July 26, 2007
You would be surprised to know that the biggest Internet Explorer issue I am facing while writing rather complex cross-browser javascript code is related to just a comma.
In javascript array if you add a comma after the last element in the array then Internet Explorer fails with a variety of undecipherable (Microsoft style) error messages. Firefox works fine. And that is the biggest and only problem I am facing with Internet Explorer while writing cross-browser javascript code. And do you know who takes the credit for that? - Ex tJS.
Ext JS is a high quality cross platform Javascript library with very impressive features out of the box by Jack Slockum. I am using it primary for displaying large amount of data and manipulating them using the Grid component. Ext JS can speed up your Web 2.0 application development by miles. Ext JS on frontend and Java on backend is what programming nirvana is made of.
Update: I did face a second bug with IE.
prabhakar |
June 18, 2010: 8:25 am
hi |
February 26, 2010: 2:57 pm
Angsuman, I am sure that you have already resolved your problem, but I think that it is important to note that you can simply add the “undefined” keyword to the end of the array so that the code will work in all browsers. For example, a JavaScript array could look like this: [1, 5, 6, "Cool", "Stuff", undefined]. Without looking at your JavaScript code, I would guess that the problem stems from the fact that Firefox ignores the last comma whereas IE takes note of it as if another element follows. Therefore, IE will say that the length of the array is one more than would be reported by Firefox. |
January 19, 2010: 3:11 pm
Hello, |
J Smith |
January 7, 2010: 4:46 pm
The syntax SHOULD be allowed. Java allows the extra comma, and the purpose is to ease maintenance of large arrays (much easier to shift ‘rows’ around while not worrying about whether to include or omit a trailing comma). |
March 18, 2008: 7:37 am
It is not a problem per se. It would seem that ie’s is the correct way to behave according to the ECMA262 standard which javascript stems from. Firefox should not allow that syntax. This issue should however be fixed in ECMAScript 4 (Javascript 2.0) |
add url