JQuery forces an older version without changing jQuery selectors without conflict

I have a page with jQuery 1.6.2. In some cases, I download an application that requires jQuery 1.4.2. I need to force the application to use version 1.4.2. I cannot change selectors ($ to $$).

Is there a way to force jQuery 1.4.2?

for example onclick the element that I am loading. Right before downloading the application, can I use getScript to download the old version of jQuery?

+5
source share
2 answers

Yes, you can, see this wonderful article at http://blog.nemikor.com/2009/10/03/using-multiple-versions-of-jquery/ .

Something like that:

<!-- load jQuery 1.6.2 -->
<script type="text/javascript" src="http://code.jquery.com/jquery-1.6.2.js"></script>

<!-- revert global jQuery and $ variables and store jQuery in a new variable -->
<script type="text/javascript">
var jQuery_1_6_2 = $.noConflict(true);

(function($){ 
   /* app code that uses jQuery 1.6.2 */ 
}(jQuery_1_6_2))

</script>


<!-- load jQuery 1.4.2 -->
<script type="text/javascript" src="http://code.jquery.com/jquery-1.4.2.js"></script>

<!-- revert global jQuery and $ variables and store jQuery in a new variable -->
<script type="text/javascript">
var jQuery_1_4_2 = $.noConflict(true);

(function($){ 
   /* app code that uses jQuery 1.4.2 */ 
}(jQuery_1_4_2))

</script>
+7
source

"" , , . , .

, HTML, .

jQuery.noConflict();  

jQuery 1.4.2 MooTools. .

+1

All Articles