A very simple (and limited) Javascript loader
Include JSLoader in your page and use it (yep, it's very simple).
JSLoader(scripts[, callback])
- scripts - (array) An array of scripts to load
- callback - (function) A function to execute when all the scripts of the array are loaded
JSLoader(['myscript.js']);
JSLoader(['myscript.js'], function(){
// myscript is loaded
});
JSLoader(['myscript1.js', 'myscript2.js'], function(){
// myscript1 and myscript2 are loaded
});
myscript2.js will load after myscript1.js completes and the callback will be executed after loading all scripts.
JSLoader(['myscript1.js]);
JSLoader(['myscript2.js]);
This will load all two scripts in parallel.