Forum: Ruby on Rails Running jQuery and prototype scripts together

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
B455036ffc83a268f77a7561f20a7ab6?d=identicon&s=25 Lyn Williams (lyntaff)
on 2009-05-25 20:07
(Received via mailing list)
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.
5fc9a2cb55d51b101285d60afebdc9c6?d=identicon&s=25 Erdwin Lianata (Guest)
on 2009-05-26 01:42
(Received via mailing list)
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
A82ba1167f4d4a8d1de63820e576a87f?d=identicon&s=25 Robby Russell (Guest)
on 2009-05-26 02:28
(Received via mailing list)
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@opaldesign.co.uk> 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]
78947e02afdcaabbda360f9d112bfbe0?d=identicon&s=25 Musdev Musdev (devrubygem)
on 2009-06-08 20:03
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@opaldesign.co.uk> 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
This topic is locked and can not be replied to.