{"id":1699,"date":"2022-08-30T15:18:42","date_gmt":"2022-08-30T15:18:42","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2013\/11\/29\/modernizr-yepnope-css-fallback-collection-of-common-programming-errors\/"},"modified":"2022-08-30T15:18:42","modified_gmt":"2022-08-30T15:18:42","slug":"modernizr-yepnope-css-fallback-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2022\/08\/30\/modernizr-yepnope-css-fallback-collection-of-common-programming-errors\/","title":{"rendered":"Modernizr Yepnope Css Fallback-Collection of common programming errors"},"content":{"rendered":"<p>I&#8217;m using a CDN to Load Bootstrap.css. My question is how can i check if CDN bootstrap was loaded\/found. And if it wasn&#8217;t, then load local Boostrap.<\/p>\n<p>Here&#8217;s Jquery fallback..<\/p>\n<pre><code>    \n        Modernizr.load([\n            {\n                load: '\/\/cdnjs.cloudflare.com\/ajax\/libs\/jquery\/1.10.1\/jquery.min.js',\n                complete: function () {\n                    if ( !window.jQuery ) {\n                        Modernizr.load([\n                            {\n                                load: config.js + 'vendor\/jquery-1.10.1.min.js',\n                                complete: function () {\n                                    console.log(\"Local jquery-1.10.1.min.js loaded !\");\n                                }\n                            }\n                        ]);\n                    } else {\n                        console.log(\"CDN jquery-1.10.1.min.js loaded !\");\n                    }\n                }\n            }\n        ]);\n    \n<\/code><\/pre>\n<p>And this is how i load Modernizr than Css:<\/p>\n<pre><code>    \n    \n    if (typeof Modernizr == 'undefined') {\n        document.write(unescape(\"%3Cscript src='\" + config.js + \"\/vendor\/modernizr-2.6.2-respond-1.1.0.min.js' type='text\/javascript'%3E%3C\/script%3E\"));\n        console.log(\"Local Modernizer loaded !\");\n    }\n    \n\n    \n        Modernizr.load([\n        {\n            load: config.css + \"bootstrap.css\",\n            complete: function () {\n                console.log(\"bootstrap.css loaded !\");\n            }\n        },\n        {\n            load: config.css + \"responsive.css\",\n            complete: function () {\n                console.log(\"responsive.css loaded !\");\n            }\n        },\n        {\n            load: config.css + \"icons.css\",\n            complete: function () {\n                console.log(\"Fontello icons.css loaded !\");\n            }\n        },\n        {\n            load: config.css + \"icons-ie7.css\",\n            complete: function () {\n                console.log(\"Fontello icons-ie7.css loaded !\");\n            }\n        },\n        {\n            load: config.css + \"animation.css\",\n            complete: function () {\n                console.log(\"Fontello animation.css loaded !\");\n            }\n        }\n        ]);\n    \n<\/code><\/pre>\n<p>I have no idea how i could check if the css was loaded.. just like i did with modernizr and Jquery..<\/p>\n<p>Thanks in advance&#8230;<\/p>\n<p id=\"rop\"><small>Originally posted 2013-11-29 06:07:01. <\/small><\/p>","protected":false},"excerpt":{"rendered":"<p>I&#8217;m using a CDN to Load Bootstrap.css. My question is how can i check if CDN bootstrap was loaded\/found. And if it wasn&#8217;t, then load local Boostrap. Here&#8217;s Jquery fallback.. Modernizr.load([ { load: &#8216;\/\/cdnjs.cloudflare.com\/ajax\/libs\/jquery\/1.10.1\/jquery.min.js&#8217;, complete: function () { if ( !window.jQuery ) { Modernizr.load([ { load: config.js + &#8216;vendor\/jquery-1.10.1.min.js&#8217;, complete: function () { console.log(&#8220;Local jquery-1.10.1.min.js [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-1699","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/1699","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=1699"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/1699\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=1699"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=1699"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=1699"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}