Javascript Library.
Commands 0 |
---|
Execute function after the document is finished loading (Trigger when the page is fully loaded).
_z.load(function);
Returns: Object _z
Make sure that no other library use _1 sign.
_1(function);
Returns: Object _z
// 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.