4

I have a jQuery widget which can be added in any websites. I am using jQuery1.7. I am in doubt that it will conflict with other javascript libraries jQuery older versions, mootools, prototype etc). I found the method jquery.noconflict(). Can anybody please give me the exact syntax to use and also where to add this in my script?

Thanks in advance for the response.

Thank you Shlomi Komemi for suggesting the link.

I am updating the answer this link

Can I use multiple versions of jQuery on the same page?

Community
  • 1
  • 1
Shah
  • 79
  • 6

1 Answers1

3
<script src="jquery-1.6.4.min.js"></script>
<script>jQuery.noConflict();</script>

But once this has been done you have to make sure you always call Jquery with the whole word instead of the $ sign.

Satya
  • 8,693
  • 5
  • 34
  • 55
  • Thank you Sathya for the quick response. You are saying that we dont need to add anything else in this code right?. Can this avoid conflict with other libraries also? – Shah Sep 06 '12 at 07:15
  • for calling jquery use whole word jQuery instead of the $ sign, and this will avoid conflict with other libs as well – Satya Sep 06 '12 at 07:47