{"id":1692,"date":"2022-08-30T15:18:39","date_gmt":"2022-08-30T15:18:39","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2013\/11\/28\/problem-about-yepnope-collection-of-common-programming-errors\/"},"modified":"2022-08-30T15:18:39","modified_gmt":"2022-08-30T15:18:39","slug":"problem-about-yepnope-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2022\/08\/30\/problem-about-yepnope-collection-of-common-programming-errors\/","title":{"rendered":"problem about yepnope-Collection of common programming errors"},"content":{"rendered":"<ul>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/c21d03301be1e6934b97fe001f02fda3?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nlsmagalhaes<br \/>\njavascript angularjs yepnope<br \/>\nI&#8217;m writing an app with mostly two javascripts, resources_loader.js and app.js, where the first loads some json files used by app.js.The problem is: app.js (which has angular.js stuff) should run only after resources_loader.js. I tried to run angular code inside the success callback (resources_loader contains a deferred), but this not seems to work well. Here&#8217;s my index.html:&lt;!doctype html&gt; &lt;html ng-app=&#8221;myapp&#8221;&gt; &lt;body&gt;&lt;script src=&#8221;angular.js&#8221;&gt;&lt;\/script&gt;&lt;script src<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/i.stack.imgur.com\/2xCT7.png?s=32&amp;g=1\" \/><br \/>\nRayraegah<br \/>\njavascript jquery google-chrome yepnope<br \/>\nI&#8217;m using yepnope.js to conditionally load css and js files into my page.I&#8217;ve merged my JS files into a single file. The structure is as follows:\/* file *\/\/\/ &#8211; copy pasted Jquery 1.7rc2.min here -(function () { console.log(&#8220;enabled hold&#8221;); jQuery.holdReady(true); })();\/\/ &#8211; copy pasted yepnope.min here -yepnope([ {test: condition,load: [css files] },{load:[js files],callback: function () {&#8230;},complete: function () { jQuery.holdReady(false); console.log(&#8220;hold released&#8221;);} }]);\/* end of file *\/and<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/6356098fc2c7b47011dcaed3b72290d2?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nFrank Parent<br \/>\njavascript css asynchronous modernizr yepnope<br \/>\nI&#8217;m trying to load a dynamically generated Google Font stylesheet using Modernizr (YepNope) but always get this error:Uncaught SyntaxError: Unexpected token ILLEGAL (css:1)My stylesheet looks like this:http:\/\/fonts.googleapis.com\/css?family=Holtwood+One+SCand I&#8217;m calling it viaModernizr.load({load: [&#8216;css!http:\/\/fonts.googleapis.com\/cssfamily=Holtwood+One+SC|Terminal+Dosis:700&#8217;],callback: function (url, result, key) {console.log(&#8216;loaded&#8230;!&#8217;); } });The website says this but for s<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/1c586dd058e14b23ceef38008d8753c5?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nMilksamsa<br \/>\njquery fancybox yepnope<br \/>\nI&#8217;m trying to conditionally load Fancybox js and css code and execute it on an element only if the element is present and I&#8217;m in a particular page. So far I&#8217;ve been trying the following code:yepnope({ test : jQuery(&#8216;body&#8217;).hasClass(&#8216;edizioni&#8217;), yep : [&#8216;\/assets\/css\/jquery.fancybox.css&#8217;,&#8217;\/assets\/js\/libs\/jquery.fancybox.pack.js&#8217;,&#8217;\/assets\/js\/libs\/jquery.mousewheel-3.0.6.pack.js&#8217;,jQuery(&#8220;#gallery a&#8221;).fancybox()] });I get a Uncaught TypeError: Object [object Object] has no method &#8216;fancybox&#8217;I guess jq<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/d23d11b57703e346333bf1da40f15f10?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nam_<br \/>\njquery ajax yepnope adobe-edge<br \/>\nSo I\u00b4m trying to retrieving an Edge animation through jQuerys $.getScript() which is the same as calling $.ajax with dataType: script.Now if I include the script with a script tag it works fine, but when I try to load and execute the script through $.getScript() nothing happens. (I dont get any errors, and the script and sub-scripts are loaded fine &#8211; but nothing happens.)Have anyone tried doing this before? I suspect I have problems loading it through AJAX because Adobe uses yepnope in page_a_ed<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/b52d11778da5529ebf67fb3150b95209?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nJonnyDevv<br \/>\nmodernizr yepnope<br \/>\nI&#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..&lt;script type=&#8221;text\/javascript&#8221;&gt;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 loaded !&#8221;);}}]);} else {console<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/df00eba7f94741fa86bb14c58b1d57db?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nAsh Clarke<br \/>\njavascript jquery document.ready yepnope asynchronous-loader<br \/>\nI have been implementing the yepnope script loader as part of the modernizr.js library. I have successfully got jQuery to load and jQuery dependent scripts afterwards. I am new to asynchronous loading of resources, so it&#8217;s a bit new to me. I have been searching around, but haven&#8217;t had much luck with the following.My question is what are your opinions on how to effectively replace the functionality of $(document).ready() when working with the yepnope.js framework. My theory was to create a approp<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/bcb7895d223afb465329e5c352bd86f0?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\ndaryl<br \/>\njavascript modernizr yepnope<br \/>\nHow come this alerts both, yes and false?Modernizr.load([{test: Modernizr.cssgradients,yep: alert(&#8216;Supports it!&#8217;),nope: alert(&#8216;Oh, damn! This browser sucks!&#8217;)} ]);I&#8217;m using the latest chrome on OS X.<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/dbabb3d83ea56bcaa9d5e327fda876d7?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nStackOverFlow<br \/>\njquery iframe internet-explorer-8 jquery-ui-dialog yepnope<br \/>\nI am using jquery modal dialogue, within dialogue we embedded iframe. iframe contain button &#8220;Show search result&#8221;at 1st attempt of &#8220;Show search result&#8221; button click, nothing happen. My result is not rendering in table (probably server request is not firing).It appears only when I switched to other tab of browesr, 2nd time onwards table rendering properly. var __run = function(getData) {yepnope({test : $.fn.flexigrid,nope : [ &#8216;www\/css\/flexigrid.css&#8217;, &#8216;\/www\/javascripts\/flexigrid.js&#8217;],complete : get<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/5c61b4a2bb3858e9fd2de8dcb9ba3e14?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nKajMagnus<br \/>\njavascript angularjs modernizr yepnope<br \/>\nModernizr.load({ both: [a, b] }) seems to executes b before a but that&#8217;s not how Modernizr is supposed to work? &#8220;yepnope.js [used by Modernizr] always executes things in the order they are listed&#8221;Modernizr versions 2.5.3 and 2.6.2.I&#8217;m loading angular.js and angular-sanitize.js like so:Modernizr.load({both: [cdnDir + &#8216;angular.js&#8217;,cdnDir + &#8216;angular-sanitize.js&#8217;,d.i.assetsUrlPathStart + &#8216;debiki-dashbar.js&#8217;],complete: bootstrapAngular })However, infrequently, angular-sanitize.js dies because angular<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/886512a50e5e89c7a10071fde2ddaa87?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\ndavydepauw<br \/>\njavascript modernizr yepnope<br \/>\nI&#8217;m trying to load in a specific CSS stylesheet depending whether certain CSS3 features aren&#8217;t supported in that browser.The JS code I use is this:\/\/ Modernizr feature tests Modernizr.load({test: Modernizr.borderradius,nope: &#8216;\/assets\/css\/border-radius.css&#8217; });In IE8 this gives, according to the developer tools:&lt;link href=&#8221;undefined&#8221; rel=&#8221;stylesheet&#8221; type=&#8221;text\/css&#8221; \/&gt;Any ideas?<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/96d1ae93249e699c53dc60f98634104f?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nbeingalex<br \/>\njavascript modernizr yepnope<br \/>\nHow do I check for FormData object using Modernizr and YepNope?&lt;script&gt; yepnope({ test : what.to.check, yep : &#8216;normal.js&#8217;, nope : &#8216;flashupload.js&#8217; }); &lt;\/script&gt;<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/f25c554453c2426b0af70720d2b58e97?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nU.J.<br \/>\nyepnope<br \/>\nI am using a &#8220;2-step view&#8221;, where I have a layout template (common for all pages) with yepnope&#8217;s load (in the html head) of jQuery and some plugins. Something like:yepnope([&#8216;\/path\/to\/jquery.js&#8217;, &#8216;\/path\/to\/jquery.plugin-common.js&#8217;]);Sometimes I need another plugin, so within the inner template I do additional (in the html body):yepnope(&#8216;\/path\/to\/jquery.plugin-additional.js&#8217;);Now that I need to do the actual js magic, can I safely do just:yepnope({complete: function(){&#8230;} });So, the questions are<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/f567b0e4816b24631a0e80dbd20e21df?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nKrisWebDev<br \/>\njavascript greasemonkey modernizr userscripts yepnope<br \/>\nWhen yepnope (which comes by default bundled in Modernizr) is used on a GreaseMonkey userscript that @runs-at document-start, the whole userscript fails with the error &#8220;n is undefined&#8221;, which means maxified that &#8220;firstScript is undefined&#8221;.Indeed it refers to the line: insBeforeObj = isGeckoLTE18 ? docElement : firstScript.parentNode,<\/li>\n<\/ul>\n<p id=\"rop\"><small>Originally posted 2013-11-28 09:37:37. <\/small><\/p>","protected":false},"excerpt":{"rendered":"<p>lsmagalhaes javascript angularjs yepnope I&#8217;m writing an app with mostly two javascripts, resources_loader.js and app.js, where the first loads some json files used by app.js.The problem is: app.js (which has angular.js stuff) should run only after resources_loader.js. I tried to run angular code inside the success callback (resources_loader contains a deferred), but this not seems [&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-1692","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/1692","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=1692"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/1692\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=1692"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=1692"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=1692"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}