yepNope TESTS

yepNope using test

by Leo Lanese

HTML

<!DOCTYPE html>
<html class="no-js">
<head>
    <meta charset="utf-8" />
    <title>Magic Box usign SVG!</title>
</head>

<body>
<script>
// key/value mapping in an object literal to name our resources
yepnope({
    test: Modernizr.localstorage,
    yep: {
         'yep-common': 'common-styles.css' },
    nope: {
         'nop-common': 'polly-styles.css',
         'nop-polly': 'storage-pollyfill.js'
    },
    
// we can reference each resource key, individually, within the callback
    callback: {
         'yep-common' : function(url,result,key) {
               alert(key + ' script loaded');
         },
         'nop-common' : function(url,result,key) {
              alert( key +' script loaded');
         },
         'nop-polly' : function(url,result,key) {
               alert(key + ' script loaded');
         }
    },
    complete : function(){
      $(function(){
        document.title = 'Modernizr was here';
      });
    }
})    
</script>    


</body>
</html>

JavaScript

/* Modernizr 2.5.3 (Custom Build) | MIT & BSD
 * Build: http://www.modernizr.com/download/#-fontface-backgroundsize-borderimage-borderradius-boxshadow-flexbox-flexbox_legacy-hsla-multiplebgs-opacity-rgba-textshadow-cssanimations-csscolumns-generatedcontent-cssgradients-cssreflections-csstransforms-csstransforms3d-csstransitions-applicationcache-canvas-canvastext-draganddrop-hashchange-history-audio-video-indexeddb-input-inputtypes-localstorage-postmessage-sessionstorage-websockets-websqldatabase-webworkers-geolocation-inlinesvg-smil-svg-svgclippaths-touch-webgl-shiv-mq-cssclasses-addtest-teststyles-testprop-testallprops-hasevent-prefixes-domprefixes-cookies-css_resize-css_scrollbars-event_deviceorientation_motion-fullscreen_api-json-load
 */
;window.Modernizr=function(a,b,c){function D(a){j.cssText=a}function E(a,b){return D(n.join(a+";")+(b||""))}function F(a,b){return typeof a===b}function G(a,b){return!!~(""+a).indexOf(b)}function H(a,b){for(var d in a)if(j[a[d]]!==c)return b=="pfx"?a[d]:!0;return!1}function I(a,b,d){for(var e in a){var f=b[a[e]];if(f!==c)return d===!1?a[e]:F(f,"function")?f.bind(d||b):f}return!1}function J(a,b,c){var d=a.charAt(0).toUpperCase()+a.substr(1),e=(a+" "+p.join(d+" ")+d).split(" ");return F(b,"string")||F(b,"undefined")?H(e,b):(e=(a+" "+q.join(d+" ")+d).split(" "),I(e,b,c))}function L(){e.input=function(c){for(var d=0,e=c.length;d<e;d++)u[c[d]]=c[d]in k;return u.list&&(u.list=!!b.createElement("datalist")&&!!a.HTMLDataListElement),u}("autocomplete autofocus list placeholder max min multiple pattern required step".split(" ")),e.inputtypes=function(a){for(var...