Tuesday 3 July 2012

Using multiple version of jQuery on same page

,
During working on project you might have encounter this problem of jquery.
There is problem coming when you are using jquery1.6 in project and you have to use jquery plugin which require jquery1.4 and it is incompatible with 1.6. So what you do remove that plugin or change your jquery  version.There is also another solution which is define below.You can use jQuery of different version easily with this following step.

<script type="text/javascript" src="jquery1.4.2.js">
</script>  
<script type="text/javascript">  
   var jq_4 = jQuery.noConflict();  
</script>  
<script type="text/javascript" src="jquery1.6.js">
</script>  
<script type="text/javascript">  
   var jq_6 = jQuery.noConflict();  
</script>  
<script type="text/javascript" src="jquery1.7.js">
</script>  
<script type="text/javascript">  
   var jq_7 = jQuery.noConflict();  
</script>  
<script type="text/javascript">  
   // You can use different instance of jquery library.   
   jq_4(document).ready(function () {  
     // so now you can use jquery jq variable instead of $ .   
     jq_4("div").hide();  
   });  
   jq_7(document).ready(function () {  
     // so now you can use jquery jq variable instead of $ .   
     jq_7("div").hide();  
   });  
</script>  
Read more →