Hello, I’ve written a script for autocomplete like Facebook; it works well on a single php page where a single jQuery version is loaded.
I’m forced to use it in a page where there are two jQuery calls: one to jquery-1.6.min.js and another to: //ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.min.js
In that case I have a problem and the JavaScript using jquery/1.7/jquery.min.js is not working.
I tried using
jQuery.noConflict();
but in that case the script using jquery-1.6.min.js is not working.
Does anyone have any suggestions?
Thanks
F.
I would suggest you to try to avoid using 2 version of jQuery on the same page if possible.
If for some reason you cannot avoid it then you have to use
noConflicton both the versions of jQuery to maintain both the versions.Something like var
$1 = jQuery.noConflict()and var$2 = jQuery.noConflict()and use these 2 different variables. Now it is very important to execute the first noConflict code before loading the second jQuery file.