I'm just getting to know modernizr and would like some confirmation that I'm doing things the in an efficient way. So I load modernizr.js and then immediately have an inline script to call Modernizr.load to load jQuery. Is this a good practice?
HTML Code:<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> <title>Handcrafted Web Design & Development</title> <link rel="stylesheet" type="text/css" href="css/reset.css" /> <link rel="stylesheet" type="text/css" href="css/hw.css" /> <script src="/js/libs/modernizr.js"></script> <script type="text/javascript"> <!-- Modernizr.load([ { load: '//ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.js', complete: function () { if ( !window.jQuery ) { Modernizr.load('/js/libs/jquery-1.7.1.min.js'); } } }, { // fallback: load: '/js/no-jQuery.js' } ]); // --> </script> </head>


Reply With Quote
Bookmarks