Reputation: 105
I need to use these two files of jquery. But these are conflict. How can I use these two files without conflict.
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.0/jquery.min.js"></script>
Upvotes: 0
Views: 110
Reputation: 777
You should use noconflict method for this purpost. See below:
First load 1.11.0
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<script type="text/javascript">
var jQuery_1_11_0 = $.noConflict(true);
<script>
Now load 1.3.0
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.0/jquery.min.js"></script>
<script type="text/javascript">
var jQuery_1_3_0 = $.noConflict(true);
<script>
Now, use jQuery_1_11_0('#selector').function(); or jQuery_1_3_0('#selector').function();
instead of $('#selector').function();
Upvotes: 0
Reputation: 3893
You don't need use both of them, jQuery 1.11.0 will do all for you. if you use old plugins that use 1.3.0 you can change it to work with 1.11.0 too. it's not hard to trace and find why your plugin dosn't work with 1.11.0 also you can use migration tools.
Upvotes: 1