Methods
-
$wk$(arguments, p_sandbox)
-
The sandbox pattern: When this function is evaluated, it first loads all modules stated in
p_modulesand then calls the callback functionfunction(p_env_1, ... p_env_n) { // code running in a sandbox }which has to be passed as last argument,Parameters:
Name Type Description argumentsObject[] A list of JSON file names (strings) and/or arbitrary objects. Each JSON file is loaded and its content is passed to the sandbox function. Every other content object is directly passed to the callback function. p_sandboxfunction As last argument the sandbox, a callback function, has to be passed: function(p_env_1, ... p_env_n){ ...}The environment parameterp_env_1, ...,p_env_ncontain theobjectscreated or passed by$wk$. So the number of arguments should be equal toarguments.length-1- Source:
- See:
-
- Stoyan Stefanov, JavaScript Patterns. O'Reilly, 2010
Properties:
Name Type Description WAIT_UNTIL_READYA dummy argument for $wk<$code> calls. When it is passed the sandbox is not executed before the HTML document has been loaded completely.WAIT_UNTIL_COMPLETEA dummy argument for $wk<$code> calls. When it is passed the sandbox is not executed before the HTML document and all its subdocuments (images etc.) have been loaded completely.