Typically when loading plugins, make sure to always include the plugin after jQuery.
<script src="https://code.jquery.com/jquery-3.1.1.min.js"></script>
<script src="some-plugin.min.js"></script>
If you must use more than one version of jQuery, then make sure to load the plugin(s) after the required version of jQuery followed by code to set jQuery.noConflict(true)
; then load the next version of jQuery and its associated plugin(s):
<script src="https://code.jquery.com/jquery-1.7.0.min.js"></script>
<script src="plugin-needs-1.7.min.js"></script>
<script>
// save reference to jQuery v1.7.0
var $oldjq = jQuery.noConflict(true);
</script>
<script src="https://code.jquery.com/jquery-3.1.1.min.js"></script>
<script src="newer-plugin.min.js"></script>
Now when initializing the plugins, you'll need to use the associated jQuery version
<script>
// newer jQuery document ready
jQuery(function($){
// "$" refers to the newer version of jQuery
// inside of this function
// initialize newer plugin
$('#new').newerPlugin();
});
// older jQuery document ready
$oldjq(function($){
// "$" refers to the older version of jQuery
// inside of this function
// initialize plugin needing older jQuery
$('#old').olderPlugin();
});
</script>
It is possible to only use one document ready function to initialize both plugins, but to avoid confusion and problems with any extra jQuery code inside the document ready function, it would be better to keep the references separate.