Ajax.Loader
This class allows dynamically load the JavaScript files (Lazy Load). It can be usefull on big projects which have a lot of JavaScript code, but you wish to reduce load time. Then code can be split into parts which whould be loaded on demand when it’s needed.
Current version: 1.0
Author: Mykhailo Stadnyk
Requires: AJAX.OOP v1.0.4 and high
[ Download ]
Usage:
// make an instance of loader (note - you can create as much loaders as you need)
window.$loader = new Ajax.Loader( 'http://example.com/scripts/');
// load tree vew core file
$loader.include( 'tree.js', function(){
// go working with tree ...
window.tree = new Ajax.Tree( optons);
// ...
});
// other code...
if (require_grid_view) {
// load grid view core file
$loader.include( 'grid.js', function(){
// working with grid...
});
}
