Why does IE6 give an "expected Identifier error" when using jQuery $.fn
I keep getting an expected identifier error at this line in my code =/
$.fn.myPlugin = $.myPlugin;
any idea why thi开发者_运维技巧s might be happening?
Actually I just found the answer here:
http://www.ventanazul.com/webzine/articles/javascript-expected-identifier-error-internet-explorer
Some coffees later I found the offending code was:
var class = $(this).parent().attr('class');
Yep, class seems to be a reserved word in Internet Explorer, thanks again Microsoft for making web developers' lives so difficult.
I just changed the variable name to fix the error, something like this:
var tabClass = $(this).parent().attr('class');
精彩评论