DOMAssistantLoad Module

The DOMAssistantLoad module offers a way to call a number of functions as soon as the DOM has loaded, as opposed to waiting for all images and other external files to completely load. It was inspired and influenced by Dean Edwards, Matthias Miller, and John Resig: window.onload (again).

DOMReady()

From any file, just call the DOMReady method with desired functions and they will be executed as soon as the DOM has loaded.

Parameters

Send in any number of function references, anonymous functions or strings with function names and parentheses.

Return value

None.

Example calls

DOMAssistant.DOMReady(myFunc);

DOMAssistant.DOMReady("myFunc('Some text')");

DOMAssistant.DOMReady(myFunc, "anotherFunction()");

DOMAssistant.DOMReady(myFunc, function(){
// Perform some magic
});

setErrorHandling()

Offers a possibility to handle errors when the DOMReady method is being called.

Parameters

Send in a function reference.

Return value

None.

Example calls

DOMAssistant.DOMLoad.setErrorHandling(function (e) {
// e is the error object passed
});

Get your copy