jsToolboxMJK.funcs.waitForPage() - mkloubert/jsToolbox GitHub Wiki
$jsTB.funcs.waitForPage(func, state, opts) method
Waits until the current page has been loaded and initialized.
Syntax
$jsTB.funcs.waitForPage(func [, state [, opts]]);
Parameters
Name | Type | Description |
---|---|---|
func | Function | The function to invoke AFTER page has been loaded and initialized. |
state | mixed | [OPTIONAL] The additional object for the function. |
opts | Object | [OPTIONAL] Additional options. |
Examples
// simple way
$jsTB.funcs.waitForPage(function() {
//TODO
});
// extended way
$jsTB.funcs.waitForPage(function(JSTB) {
//TODO
});
// with state
$jsTB.funcs.waitForPage(function(JSTB, state) {
// 'TM+MK'
alert(state + '+MK');
}, 'TM');