UnderZ

Javascript Library.

(REMOVED in v1.0.1) The Document Load Event

Execute function after the document is finished loading (Trigger when the page is fully loaded).


Method 1: Default way.

_z.load(function);

Returns: Object _z


Method 2: Shorter way.

Make sure that no other library use _1 sign.

_1(function);

Returns: Object _z


Examples

// change document title when DOM is fully loaded
_z.load(function () {
	document.title = "Document is ready";
});

// print the title first thing in <body> when DOM is fully loaded
_1(function () {
	_z("body").prepend(document.title);
});


// you can also use function name
function newTitle() {
	document.title = "DOM is fully loaded";
}
_1(newTitle);

// this returning only when DOM is fully loaded.
function returnTest() {
	return "Only when DOM is fully loaded";
}

_z.load( returnTest ); // _z
_1( returnTest ); // _z

_z.load( returnTest ) === _z; // true
_1( returnTest ) === _z; // true

Use your own way.