Skip to content

Instantly share code, notes, and snippets.

@arozwalak
Last active March 9, 2017 22:08
Show Gist options
  • Save arozwalak/7469397 to your computer and use it in GitHub Desktop.
Save arozwalak/7469397 to your computer and use it in GitHub Desktop.
Javascript: Modernizr
<!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