0

How to use jQuery file for specific part of body. Because i changed the original version of jQuery tools file and i want to use both file(changed and original) in a Html page

FreshBits
  • 1,003
  • 4
  • 13
  • 25

2 Answers2

1

jQuery.noConflict() was added in **v1.1** to support loading jQuery on a page with other code that uses the global **$** variable; and to make it easy to load multiple versions of jQuery on the same page

For Example:

<script type="text/javascript" src="other_lib.js"></script>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript">
  jQuery.noConflict();
  jQuery(document).ready(function($) {
    // Code that uses jQuery's $ can follow here.
  });
  // Code that uses other library's $ can follow here.
</script>

For detail explanation and tutorial. Please visit following:

http://api.jquery.com/jQuery.noConflict/

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

http://blog.nemikor.com/2009/10/03/using-multiple-versions-of-jquery/

Hope this helps.

Community
  • 1
  • 1
talha2k
  • 24,937
  • 4
  • 62
  • 81
0

Check out jQuery's noConflict() function. This way you can assign one version of jQuery to $ and a second one to any var: http://api.jquery.com/jQuery.noConflict/

Ahmed Nuaman
  • 12,662
  • 15
  • 55
  • 87