IE8 expected identifier error

时光毁灭记忆、已成空白 提交于 2019-12-10 14:31:45

问题


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!


回答1:


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.




回答2:


If you cannot rename, I suggest next:

response.responseJSON.messages.default

change to

response.responseJSON.messages['default']


来源:https://stackoverflow.com/questions/17490398/ie8-expected-identifier-error

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!