views:

45

answers:

3

Hi,

I know that I can use

 <script type="text/javascript">
    jQuery.noConflict();
 </script>

to resolve the conflict between prototype and jquery after including all jquery and prototype libraries in the head section. However, I am including another .js file in the head section which dynamically loads a jquery plugin in window.load function. Now I get the conflict. Can someone tell me how to resolve this. Where do I specify the jquery.noConflict()

thanks.

A: 

Where do I specify the jquery.noConflict()

You should put jQuery.noConflict(); just after the line where jQuery library is included.

Sarfraz
I get the following error from prototype (inline !== false ? this : this.toArray())._reverse is not a function
+1  A: 

I suspect it's all in the order:

  1. load prototype
  2. load jquery
  3. run jQuery.noConflict();
  4. load other js file

edit: oops, you need to include prototype first. (ref)

Mark E
+1... yeah that will do...
Reigel
I included them in the above order. I get the following error from prototype(inline !== false ? this : this.toArray())._reverse is not a function
@ash34: sorry, looks like you need to include prototype first, see the new order.
Mark E
no still get the same error with the new order.
A: 

Load the main jQuery file first of all your .js files.

Then insert the noConflict() - block directly after you load the jQuery library (before any other script files).

Kristian J.
I included them in the above order. I get the following error from prototype (inline !== false ? this : this.toArray())._reverse is not a function