Blog

May
29

Getting JQuery and Prototype to place nice

Posted by Michael Cindric in development, javascript, jquery | No Comments »

If you want to use JQuery in your rails application but still want prototype working as well there is a simple way to make sure they play nice and work side by side. All you have to do after you include your JQuery includes code is have the following

  <script>
   var $j = jQuery.noConflict();
  </script>

Now all you have to do to use jquery is use “$j” instead of just “$” and your good to go. To use just the standard prototype library is still just “$”. Simple isn’t it

Leave Your Response

Name*
Email*
Website URL
Comments*
* Name, Email, Comment are Required
*

Spam Protection by WP-SpamFree