views:

126

answers:

1

I keep getting an expected identifier error at this line in my code =/

   $.fn.myPlugin = $.myPlugin;

any idea why this might be happening?

A: 

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 lifes so difficult.

I just changed the variable name to fix the error, something like this:

var tabClass = $(this).parent().attr('class');

codeninja
I wouldn't worry too much about it. Any of your users still using IE6 deserve such errors.
Josh Einstein