Module is a project mainly written in JavaScript, it's free.
Experimental javascript loader, based on exception-reload
This is a toy javascript loader that has not had the benefit of extensive browser testing. Since it was begun, several better options have appeared.
Most this should be pretty standard. The two novel features are:
Files should contain a header to express dependancies. 'leaf' modules require no modification. The header takes the form of "new Module" with the module name (which must match the file name) and a function which imperitively sets the dependencies.
new CGD.Module('module', function(m) {
m.enqueue('./child');
});
If the 'child' module is not yet available, script loading will be aborted by raising an exception. If the browser supports the onerror
event, this exception will be filtered out before reaching the console.
The failed module function will be retried by one of two means:
If the module function runs without error the first time (e.g. executing the file), it will simply allow the file to continue. If it runs without error on a retry, a new script tag will be inserted to-run the file.