Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
please simplify the solution for prototype and jquery on the same page!
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  3 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
geoffcox  
View profile  
 More options Apr 18 2011, 8:37 am
From: geoffcox <g...@freeuk.com>
Date: Mon, 18 Apr 2011 05:37:10 -0700 (PDT)
Local: Mon, Apr 18 2011 8:37 am
Subject: please simplify the solution for prototype and jquery on the same page!
Hello

I read that there is a problem with prototype and jquery being used on
the same page and that the solution involves the use of

jQuery.noConflict()

but I am far from clear how to use this!

I have

1. prototype and soundmanager2.js to play some sounds, and

2. jquery-1.5.1.js and fadeslideshow to run a slideshow, and

3. jquery-1.5.1.js and jquery.featureCarousel.min.js to run a carousel
of images.

and with IE6 I get the error message  re line 5734 in prototype.js,
"Object doesn't support this property ot method" - this line having

element.dispatchEvent() on it.

All 1, 2 and 3 work by the way.

How do I prevent the error message?

Cheers

Geoff


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
joe t.  
View profile  
 More options Apr 18 2011, 8:27 pm
From: "joe t." <thooke...@gmail.com>
Date: Mon, 18 Apr 2011 17:27:42 -0700 (PDT)
Local: Mon, Apr 18 2011 8:27 pm
Subject: Re: please simplify the solution for prototype and jquery on the same page!
<script type="text/javascript" src="/path/to/jquery.js"></script>
<!-- Add in any jQuery plugins here while $ still refers to jQuery -->
<script type="text/javascript">$j = $.noConflict();</script>
<script type="text/javascript" src="/path/to/prototype.js"></script>
<!-- Add any Prototype extensions -->

When you want to use jQuery, use the replaced shortcut call to $j
(this is an arbitrary reassignment - could be anything that
distinguishes it from Prototype's $). Prototype's $ here replaces
jQuery's.
Anything you use to extend jQuery you should load before reassigning
jQuery's $ (i do it for safety, and clarity in my code). Then after
the reassignment, load Prototype and any of its extensions.

i use this setup reliably in my code. Maybe there's more to it than
that, but i have yet to encounter a situation where there's been a
conflict.
-joe t.

On Apr 18, 8:37 am, geoffcox <g...@freeuk.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
geoffcox  
View profile  
 More options Apr 19 2011, 5:28 am
From: geoffcox <g...@freeuk.com>
Date: Tue, 19 Apr 2011 02:28:50 -0700 (PDT)
Local: Tues, Apr 19 2011 5:28 am
Subject: Re: please simplify the solution for prototype and jquery on the same page!
Thanks Joe.
I have also come across a version of soundmanager2 which uses jQuery

http://plugins.jquery.com/node/11402

Cheers

Geoff

On Apr 19, 1:27 am, "joe t." <thooke...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »