INCLUDE_DATA

Entries Tagged 'jQuery' ↓

jQuery and IE blues

Getting a “Expected identifier, string or number” error in IE using jQuery? Yeah I know, it takes forever to debug. In my case it was because I had one of those in my code:

$(element_id).attr({class: ’signup_label_err’});

Apparently, class is a reserved keyword and this is what causes the error. Solution? Easy, just replace it with:

$(element_id).addClass(’signup_label_err’);

Enjoy IE worry-free days.