Last active
March 9, 2017 22:08
-
-
Save arozwalak/7469397 to your computer and use it in GitHub Desktop.
Javascript: Modernizr
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
<!doctype html> | |
<html class="no-js"> | |
<head> | |
<meta charset="utf-8"> | |
<title>Modernizr</title> | |
<style> | |
.flexbox { | |
} | |
.no-flexbox .container { | |
} | |
</style> | |
<!-- after stylesheets --> | |
<script src="http://www.modernizr.com/downloads/modernizr-latest.js"></script> | |
</head> | |
<body> | |
<script> | |
// test if browser support | |
// not included in development version, use in custom version | |
Modernizr.load({ | |
test: Modernizr.localstorage, | |
yep: 'something.js', // if it support | |
nope: 'somethingelse.js' //if it not support | |
complete: function() { | |
alert('do something'); | |
} | |
}) | |
if (!!navigator.geolocation) | |
if(Modernizr.localstorage) { | |
} | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment