Global

Methods

$wk$­(arguments, p_sandbox)

The sandbox pattern: When this function is evaluated, it first loads all modules stated in p_modules and then calls the callback function
function(p_env_1, ... p_env_n)
{ // code running in a sandbox 
}
which has to be passed as last argument,
Parameters:
Name Type Description
arguments Object[] 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_sandbox function As last argument the sandbox, a callback function, has to be passed: function(p_env_1, ... p_env_n){ ...} The environment parameter p_env_1, ..., p_env_n contain the objects created or passed by $wk$. So the number of arguments should be equal to arguments.length-1
Properties:
Name Type Description
WAIT_UNTIL_READY A 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_COMPLETE A 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.
Source:
See:
  • Stoyan Stefanov, JavaScript Patterns. O'Reilly, 2010
W. Kowarschick © 2013 (CC BY-NC-SA 3.0: http://creativecommons.org/licenses/by-nc-sa/3.0/)
Documentation generated by JSDoc 3.3.0-dev on Thu Nov 14 2013 13:33:07 GMT+0100 (MEZ) using the DocStrap template.