Last active
August 29, 2015 14:02
-
-
Save zachwolf/10aa4a567efe561f076a to your computer and use it in GitHub Desktop.
modernizr with jquery and tests
This file contains 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
<script> | |
// only load scripts if it's for desktop | |
if (Modernizr.mq('(min-width: 500px)')) { | |
Modernizr.load([ | |
{ | |
load: '//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.js', | |
complete: function () { | |
// only load jquery if the cdn version isn't available | |
if ( !window.jQuery ) { | |
Modernizr.load('scripts/lib/jquery.js'); | |
} | |
} | |
}, | |
{ | |
load: ['scripts/lib/underscore.js', 'scripts/app.js'] | |
} | |
]); | |
} | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment