Skip to content

Instantly share code, notes, and snippets.

@jpalala
Created May 25, 2014 05:00
Show Gist options
  • Save jpalala/54ffde736f6d5a5702dc to your computer and use it in GitHub Desktop.
Save jpalala/54ffde736f6d5a5702dc to your computer and use it in GitHub Desktop.
modernizer_script_beginners
yApp = {
init: function() {
}
}
Modernizr.load({
test: Modernizr.geolocation && Modernizr.fontface && Modernizr.canvas && Modernizr.cssgradients,
yep : 'geo.js',
nope: ['geo-polyfill.js','presentational-polyfill.js', 'presentational.css']
},
// Functional polyfills
{
// This just has to be truthy
test : Modernizr.websockets && window.JSON,
// socket-io.js and json2.js
nope : 'functional-polyfills.js',
// You can also give arrays of resources to load.
both : [ 'app.js', 'extra.js' ],
complete : function () {
// Run this after everything in this group has downloaded
// and executed, as well everything in all previous groups
myApp.init();
}
},
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment