Last active
December 19, 2015 15:09
-
-
Save stugoo/5973965 to your computer and use it in GitHub Desktop.
Modernizr Test for jQuery 2.0
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* 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)); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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