JSFiddle - React, Tailwind, and code Playground
by Leo Lanese
HTML
<script src="http://modernizr.com/downloads/modernizr-latest.js"></script>
<!--
List of polyfills:
https://github.com/Modernizr/Modernizr/wiki/HTML5-Cross-Browser-Polyfills
Think Progressibly!....Think about features!
-->
JavaScript
var touch = Modernizr.touch; // detecting touch feature
var canvas = Modernizr.canvas; // and canvas
yepnope([
{
test: Modernizr.mq('only all'),
nope: './js/lib/respond.min.js'
},
{
test : touch,
yep : './js/touch.js',
nope : ['./js/no-touch.js', './css/no-touch.css'],
callback : function () {
if(console.log){
console.log("Modernizr touch feature: ", Modernizr.touch);
};
}
},
{
test : canvas,
yep : './js/canvas.js',
nope : document.getElementById('canvas').css({'background':'tan'}),
callback : function () {
if(console.log){
console.log("Modernizr canvas feature: " + Modernizr.canvas);
};
}
},
{
load: [ "./js/core.js"],
callback: function (url, result, key) {
if (console.log && url === '../js/module1.js') {
console.log('module1 loaded');
}
if (console.log && url === '../js/module2.js') {
console.log('module2 loaded');
}
}
}
]);