0

Suppose i have different versions of jquery.min.js and other version .If i want to include both in html script tag,may be there is a conflict over those files which have to choose.So can we overcome that conflict

Naga Bhavani
  • 105
  • 1
  • 3
  • 12

1 Answers1

0

Multiple versions of jQuery can be included by using noConflict. For instance, if you wanted to include the 1.x and 2.x versions on the same page, you could reference each by supplying an alias:

<script src="http://code.jquery.com/jquery-2.1.4.min.js"></script>
<script src="http://code.jquery.com/jquery-1.11.3.min.js"></script>
<script>var jq1x = jQuery.noConflict();</script>
<script>
  // $ == jQuery 2.x
  $('#foo').on('click',function(){
    // binding using 2.x
  });
</script>
<script>
  (function($){
    // $ == jQuery 1.x
    $('#bar').on('click',function(){
      // binding using 1.x
    });
  })(jq1x);
</script>
Brad Christie
  • 100,477
  • 16
  • 156
  • 200