Jc John Jc John - 2 months ago 8
jQuery Question

jquery conflict issue but i need both of them

How can i make two jquery both of them would work fine in my code. I have a conflict jquery thats why its not working fine. but when i erase the other one, the other one requires the other version of the jquery. From here i have a conflict jquery:

<script src="<?php echo base_url('assets/jquery/jquery-2.1.4.min.js')?>">
</script>
<script src="<?= base_url() ?>assets/manager/js/jquery.min.js">
</script>


If i delete the first one, my dropdown doesnt come out, if i delete the second one, the dropdown of my logout menu doesnt come out.

Answer

try to save jquery in any other object. then use that object inside second jquery like this

var jq=jQuery.noConflict();

now use this jq inside second jquery after this save jq's value in jquery loke this

var jQuery=jq.noConflict();