Home > Java Script > IE7.0-Expected Identifier or String…Bang the bug

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

December 31, 2008 Leave a comment Go to comments


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
  1. sunny
    May 2, 2011 at 5:14 pm

    thanks….helped a lot… 🙂

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: