Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Prototype and jQuery together?

I noticed that a certain script I use relies on prototype. (Lightbox 2) Will it work together on the same page as jQuery? Is there way to make sure that they don;t conflict?

like image 319
Moshe Avatar asked Mar 17 '26 23:03

Moshe


2 Answers

You can but you need to take special steps if you're using the $() special function. Basically it comes down to the order you call libraries and/or calling jQuery.noConflict().

like image 175
mopoke Avatar answered Mar 19 '26 14:03

mopoke


Use jQuery.noConflict so that you are required to make calls using the jQuery object explicitly (i.e. jQuery('#selector') instead of the $ alias.

like image 39
Michael Greene Avatar answered Mar 19 '26 14:03

Michael Greene