Although there are many solutions provided even here at stackoverflow, none of them seems to work. I’ve found many people complaining about this on the net. How to load 2 different jquery files on the same page? Or some workaround this. To me, it is working only the one that is the last called on the page.
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
<script>
var jq162 = jQuery.noConflict();
</script>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js"></script>
<script>
var jq151 = jQuery.noConflict();
</script>
I tried this also:
<script type="text/javascript">
(function(){
var myBkl = {
jq: null,
loadScript: function(src) {
if(window.jQuery && window.jQuery.fn.jquery == '1.6.2'){
return;
}
var s = document.createElement('script');
s.setAttribute('src', src);
s.setAttribute('type', 'text/javascript');
document.getElementsByTagName('head')[0].appendChild(s);
},
whenLoaded: function(callback){
if (typeof(window.jQuery) !== 'undefined' && window.jQuery.fn.jquery == '1.6.2') {
myBkl.jq = window.jQuery.noConflict(true);
callback(myBkl.jq);
}
else {
setTimeout((function() {myBkl.whenLoaded(callback); }), 100);
}
},
init: function($){
console.log($.fn.jquery);
console.log(window.jQuery.fn.jquery);
}
};
myBkl.loadScript('http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js');
myBkl.whenLoaded(myBkl.init);
})();
</script>
Why do you need 2 different versions of jQuery in the first place?
I’m pretty sure you can make everything work with 1.6.2 (given some very little changes like prop()… )