Skip to content

Instantly share code, notes, and snippets.

@stugoo
Last active December 19, 2015 15:09
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stugoo/5973965 to your computer and use it in GitHub Desktop.
Save stugoo/5973965 to your computer and use it in GitHub Desktop.
Modernizr Test for jQuery 2.0
/* REQUIRES http://modernizr.com/download/#-addtest-json-script_defer-load */
(function(window, document, Modernizr, undefined) {
'use strict';
Modernizr.addTest('jQueryVersion', function() {
return (
Modernizr.json &&
Modernizr.scriptdefer &&
'addEventListener' in window &&
'querySelector' in document
);
});
}(this, this.document, Modernizr));
function(window, document, Modernizr, undefined) {
'use strict';
Modernizr.load([
{
test : Modernizr.jQueryVersion,
yep: {
// jquery 2.something
'jquery' : 'http://code.jquery.com/jquery-2.0.2.min.js'
},
nope : {
// jquery 1.whatever
'jquery' : 'http://code.jquery.com/jquery-1.10.1.min.js'
},
complete: function () {
// INIT();
}
}
]);
}(this, this.document, Modernizr));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment