Is it possible to handle conflicts between 2 versions of jQuery loaded in the same page? Assume that these lines of code:
<script type="text/javascript" src="jquery-1.1.3.js"></script>
<script type="text/javascript" src="jquery-1.4.2.js"></script>
<script type="text/javascript" src="thisFileUsesFirstJquery.js"></script>
<script type="text/javascript" src="thisFileUsesSecondJquery.js"></script>
I don't use inline java script code. In my situation, my java script code take place on external file. My question is: How should I use noConflict() method that prevent from conflicting between them.
yes you can do it like this:
<script type="text/javascript" src="jquery-1.1.3.js"></script>
<script> $113 = jQuery.noConflict();</script>
<script type="text/javascript" src="jquery-1.4.2.js"></script>
and then use either $113 or $ in your code
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With