I was successfully using some plugin for about 6 months on my website and all of a sudden I started getting this message for one of my scripts: “$ is undefined”.
This is the problematic line of code: $.widget("ui.ImageColorPicker", uiImageColorPicker);
I’m using this plugin and almost the newest jQuery with noConflict enabled: http://github.com/Skarabaeus/ImageColorPicker I didn’t change anything for 6 months (I didn’t update jQuery). I’m sure it worked fine just 2 weeks ago and now it’s broken all of a sudden.
EDIT: Error is gone. I’m removing example website.
It looks like a variable scope issue.
Try changing the first line to this:
and the last line to this:
By doing this we are passing in the
jQueryobject to the anonymous function which surrounds the plugin, but by referencing it as$the code within the block can be written using ‘normal’ jQuery, while still maintaining the noConflict mode on the rest of the page.