Question

I have just started using html5 boilerplate and one problem I have come across is using the DW widget Flexslider2 which references the jquery-1.7.2.min.js from the head section in my document.

Boilerplate Modernizr references jquery-1.9.1.min.js at the end of the document so this cancels out 1.7.2.min and prevents the Slider from showing when the page is published, once the later script jquery-1.9.1.min.js is removed the Slider shows perfectly but does that mean that Modernizr script no longer functions?

The problem is obviously because the later script always overrides the 1st

How to get the 2 working from the same jQuery library (preferably the latest version)?

Was it helpful?

Solution

use modernizr.js in the head (because it won't work well in the body when rendering in IE7) then at the end before your jQuery-1.9.1.min.js and under that any jquery plugin you are using and after that the javascript you wrote to apply the jquery plugins or JS.

The order of which you load is important: If you would first load your jQuery plugin and after that the jQuery-19.1.min.js it won't load properly because it won't understand your plugin without loading jQuery-1.9.1.min.js

OTHER TIPS

You can include

<script src="http://code.jquery.com/jquery-migrate-1.2.1.js"></script>

This plugin can be used to detect and restore APIs or features that have been deprecated in jQuery and removed as of version 1.9. See https://github.com/jquery/jquery-migrate/#readme for more informations.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top