Archive for December, 2008

IE7.0-Expected Identifier or String…Bang the bug

December 31, 2008 1 comment


While testing my application, I was very happy by getting smooth run on the FireFox and Safari.  But when I tested that on IE7.0, I was banged with the error popup-

“Expected identifier or string”

on the very first page of the application. I started trying out putting few alerts on the very first javascript file loaded, but failed. After digging a lot, I found the way to get-rid-of this issue. Here is the soultion-

The problem JavaScript code was-

1    function txtCellEditor(){
2        var txt = new YAHOO.widget.TextboxCellEditor({
3                  asyncSubmitter: asyncUpdate,
4                  validator:YAHOO.widget.DataTable.validateNumber,
5                  });
6        return txt;
7    }

The main problem was the “,”(comma) at the line 4. I removed the comma and the application started working fine on IE7 also.

Actually for IE, there should be no comma after the function closing(after the braces{}), or the parameters passed to the functions or the class constructors. IE considers that as a new line.

Enjoy debugging……

Categories: Java Script