Hi I have a rails appplication that uses jquery and prototype for different features. When adding the jquery library it seems all features in the application that uses prototype stop working. Should this happen? and if this is the case, how can I solve this? Many Thanks in advance.
Both jquery and prototype using $ sign for accessing DOM, you should change it to jQuery instead. jQuery(''your_variable'').method() http://docs.jquery.com/Using_jQuery_with_Other_Libraries lyntaff wrote:> Hi > > I have a rails appplication that uses jquery and prototype for > different features. > > When adding the jquery library it seems all features in the > application that uses prototype stop working. > > Should this happen? and if this is the case, how can I solve this? > > Many Thanks in advance.
You''ll need to execute this after you load the jQuery file.. jQuery.noConflict(); Robby On Mon, May 25, 2009 at 11:06 AM, lyntaff <lyn-XFkl2lNNjp7BrJGnFWTVgQ@public.gmane.org> wrote:> > Hi > > I have a rails appplication that uses jquery and prototype for > different features. > > When adding the jquery library it seems all features in the > application that uses prototype stop working. > > Should this happen? and if this is the case, how can I solve this? > > Many Thanks in advance. > > >-- Robby Russell Chief Evangelist, Partner PLANET ARGON, LLC design // development // hosting w/Ruby on Rails http://planetargon.com/ http://robbyonrails.com/ http://twitter.com/planetargon aim: planetargon +1 503 445 2457 +1 877 55 ARGON [toll free] +1 815 642 4068 [fax]
Robby Russell wrote:> You''ll need to execute this after you load the jQuery file.. > > jQuery.noConflict(); > > Robby > > On Mon, May 25, 2009 at 11:06 AM, lyntaff <lyn-XFkl2lNNjp7BrJGnFWTVgQ@public.gmane.org> wrote: >> >> Many Thanks in advance. >> > >> > > > > -- > Robby Russell > Chief Evangelist, Partner > > PLANET ARGON, LLC > design // development // hosting w/Ruby on Rails > > http://planetargon.com/ > http://robbyonrails.com/ > http://twitter.com/planetargon > aim: planetargon > > +1 503 445 2457 > +1 877 55 ARGON [toll free] > +1 815 642 4068 [fax]Mine is the total opposite, maybe:), thats if my setup is configured correctly. I put my jquery-1.3.2.js in my projects /public/javascripts folder. I created a js script called jo.js in /public/javascripts that looks like this: $(document).ready(function() { $(''a'').click(function() { $(''#box'').fadeout(''slow''); }); }); This is how I referenced the jo.js file in my html file: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <script src="/javascripts/jquery-1.3.2.js" type="text/javascript"></script> <title>index</title> <%= javascript_include_tag "jo.js" %> <%= stylesheet_link_tag "jcss" %> </head> <body> <div id="box"></div> <a href="#">Click Me!</a> </body> </html> When i click on the click me link the box above it is supposed to fade out, this is not happening. Thanks -- Posted via http://www.ruby-forum.com/.