Skip to content


Rails with jQuery and Prototype

I found out about jQuery today when I watched this weeks railscast, and thought it was a much better date picker than what I have been using so far, but I had a couple challenges when trying to use it right off.

In my app I also use prototype, which uses the $ function…just like jQuery. Fortunately there is a work around. All that is needed is a simple javascript in the header. Something like this should work well:

1
  var $j = jQuery.noConflict();

That then allows you to use both jquery as well as prototype in the same application. Anywhere you need to use jquery instead of doing a $() you use use $j instead.

Posted in programming.


0 Responses

Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.



Some HTML is OK

or, reply to this post via trackback.