Reputation: 753
i m working on a website which uses an old version of Jquery (1.4.4), i can t update this version. I want to add Twitter Bootstrap plugins. How can i use jquery no conflict with these plugins because they are interfering with others functions of the website using Jquery 1.4? The pattern of bootstrap plugins is like this :
!function($) {
// code here
// plugin definition here
} ( window.jQuery);
Maybe like this ? :
<script type="text/javascript" src="/js/jquery.min17.js"></script>
<script>
var jq17 = jQuery.noConflict();
</script>
<script type="text/javascript" src="/js/bootstrap-tab.js "></script>
Upvotes: 1
Views: 10602
Reputation: 75133
It's quite simple
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"></script>
<script>
var $ = jQuery.noConflict();
</script>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script>
var jq17 = jQuery.noConflict();
</script>
Live Example: http://jsbin.com/elomit/edit#javascript,html,live
Upvotes: 4