$loader
.load('js/jquery.min.js')
.done(function(){
// Stop jQuery from triggering the "ready" event
$.holdReady(true)
})
.load([
'js/script-one.min.js'
, 'js/script-two.min.js'
])
.ready(function() {
// Allow jQuery to trigger the "ready" event
$.holdReady(false)
// Start app
});
We tested YepNope, which is a great loader, but felt it could be faster. It also had features we didn’t really need. So we wrote our own. We reinvented the wheel. How hard could it be? Well, it was pretty hard.
What we needed was a resource loader that could load, not only JavaScript but stylesheets as well. It also needed to be able to load resources in parallel and in groups to handle dependencies, such as loading jQuery before loading a jQuery plugin. The final requirement was conditional loading, i.e. load JSON.js if the browser is lacking native JSON support.
JAL Source (GitHub) →
JAL – Just Another Loader for JavaScript →