Just by launching a new HTML5 project and using modernizr.js
I noticed on the modernizr docs page that you can use the following:
Modernizr.load([ { load: '//ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.js', complete: function () { if ( !window.jQuery ) { Modernizr.load('js/libs/jquery-1.6.1.min.js'); } } } ]);
So in my HTML this is:
<script src="scripts/modernizr-2.0.6.js"></script> <script> Modernizr.load([ { load: 'https://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js', complete: function () { if ( !window.jQuery ) { Modernizr.load('scripts/jquery-1.6.1.min.js'); } } } ]); </script>
But looking at firebug, jquery loading fails.
Did I miss something obvious here?
Cheers, Adi
source share