Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IE8 expected identifier error

IE 7 & 8 throws an error (through jQuery): expected identifier

jQuery(document).ready(function() {
    jQuery.i18n.properties({
                    'name': "messages", 
                    'path': "/myproject/js/i18n/", 
                    'mode': "both",
                    'language': "en", 
                    'callback': function() {
                    }
    })
});

If I comment out line 'path': "/myproject/js/i18n/", error disappears, but of course, i18n plugin stops working as expected.

Thanks for your help!

like image 911
Michael Zelensky Avatar asked Jul 05 '13 13:07

Michael Zelensky


2 Answers

In messages.properties file there were lines like something.delete.something=something. These lines with 'delete' inside caused jQuery in IE7/8 to throw the error. I renamed these labels into something.dodelete.something and it worked.

like image 195
Michael Zelensky Avatar answered Nov 16 '22 21:11

Michael Zelensky


If you cannot rename, I suggest next:

response.responseJSON.messages.default

change to

response.responseJSON.messages['default']
like image 35
Artem Chernovol Avatar answered Nov 16 '22 21:11

Artem Chernovol