Skip to content

Instantly share code, notes, and snippets.

@zachwolf
Last active August 29, 2015 14:02
Show Gist options
  • Save zachwolf/10aa4a567efe561f076a to your computer and use it in GitHub Desktop.
Save zachwolf/10aa4a567efe561f076a to your computer and use it in GitHub Desktop.
modernizr with jquery and tests
<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