I have quick question about jQuery plugins, hope somebody out there has some advice.
I’m working with a jQuery plugin that has been working as expected, but in the last couple of days we upgraded from jQuery 1.1.4 to 1.4.2.
After a lot of debugging, I was able to realize that in the old plugin, selectors are written as follows:
$('img[@id&=myImage]').each ...
Once we upgraded to the latest version of jQuery, I started getting JavaScript errors as follows:
uncaught exception: Syntax error, unrecognized expression: [@id&=myImage]
As you can see, the selector includes an “@” symbol (which I believe is the one causing the error) and after consulting the jQuery documentation about all the different type of selectors, I was not able to find whether this was correct or not, given that it worked before and now it doesn’t.
At this point I have to figure out if I can use the old plugin with the new version of jQuery or if I have to come up with an alternative solution.
I’d appreciate any advice.
Thanks
The
@for attribute selectors was removed in jQuery 1.3, just take it out, like this:Also I’m not sure what
&=would have referred to, I think you want one of the other attribute selectors here, possibly starts-with (^=) or ends-with ($=)?