JSFiddle - React, Tailwind, and code Playground
by dergachev
HTML
<p>Demo showing scenario where yepnope.js will call complete() before all dependencies are finished loading.
<p>See javascript console for error message.
<p> Note that this bug is present in yepnope 1.5.4; including the current trunk (https://raw.github.com/SlexAxton/yepnope.js/master/yepnope.js) makes it go away.
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script type="text/javascript" src="
//cdnjs.cloudflare.com/ajax/libs/jquery-powertip/1.1.0/jquery.powertip.js"></script>
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/yepnope/1.5.4/yepnope.min.js
"></script>
<!-- uncomment the following to confirm that this bug is fixed in yepnope trunk -->
<!--
<script type="text/javascript" src="https://raw.github.com/SlexAxton/yepnope.js/master/yepnope.js
"></script>
-->
JavaScript
yepnope([{
test: typeof(window.jQuery) === 'undefined' || jQuery.fn.jquery.match(/^1\.[0-9]+/) < 1.7,
yep: '//cdnjs.cloudflare.com/ajax/libs/jquery/2.0.0/jquery.min.js'
},
{
test: typeof(window.jQuery) === 'undefined' || typeof(window.jQuery.fn.jGrowl) === 'undefined',
yep: ['//cdnjs.cloudflare.com/ajax/libs/jquery-jgrowl/1.2.12/jquery.jgrowl.min.js','//cdnjs.cloudflare.com/ajax/libs/jquery-jgrowl/1.2.12/jquery.jgrowl.css'],
complete: function() {
console.log('completed loading jGrowl (should fire first, or not at all)');
}
},
{
test: typeof(window.jQuery) === 'undefined' || typeof(window.jQuery.fn.powerTip) === 'undefined',
yep: ['//cdnjs.cloudflare.com/ajax/libs/jquery-powertip/1.1.0/jquery.powertip.js','//cdnjs.cloudflare.com/ajax/libs/jquery-powertip/1.1.0/jquery.powertip.min.css'],
complete: function() {
console.log('completed loading powertip (should fire last, all dependencies should be loaded)');
jQuery.jGrowl("this throws an error with yepnope 1.5.4");
}
}
]);