arozwalak
11/14/2013 - 4:06 PM

Javascript: Modernizr

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>