I have to pages, first for sortable list (li), which used the following javascripts:

<link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.1/themes/base/jquery-ui.css" rel="stylesheet" type="text/css" />
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.1/jquery-ui.min.js"></script>

The second page for mmenu which have the following jquery:

<script type="text/javascript" src="http://code.jquery.com/jquery-3.2.1.min.js"></script>
<script type="text/javascript" src="/theme/mmenu/dist/jquery.mmenu.all.js"></script>

When I want to add both scripts into a single page( where menu and sortable are working), there are some errors appear since when I remove Jquerys of sortable then the mmnue will work, and when I remove Jquery of sortable then mmenu won't work!!

SO please how to get both of them work on a single page?

Thanks

1 Answers

2
Husman On

This is possible using jQuery.noConflict()

Something like:

<script src='jquery-1.3.2.js'></script>
<script>
var jq132 = jQuery.noConflict();
</script>
<script src='jquery-1.4.2.js'></script>
<script>
var jq142 = jQuery.noConflict();
</script>

See this for more examples: http://blog.nemikor.com/2009/10/03/using-multiple-versions-of-jquery/