API.html
Summary
API for Wanaplan html helpers.
Constructor
API.html
Syntax
API.html
()
Summary
Item Index
Methods
Methods
addCSS
Syntax
addCSS
(
-
url -
success -
fail
Summary
Adds a CSS stylesheet to the document.
addHTML
Syntax
addHTML
(
-
url -
domElement -
success -
fail
Summary
Loads and adds an HTMLElement to the document.
Parameters:
-
urlStringThe url of the HTML element to load.
-
domElementHTMLElementAn instance of a DOM element.
-
successFunctionA function called if the operation is completed successfully.
-
failFunctionA function called if the operation fails.
addScript
Syntax
addScript
(
-
url -
success -
fail
Summary
Loads a script in the document.
addScripts
Syntax
addScripts
(
-
scripts -
[options] -
[successCallback] -
[errorCallback] -
[interval]
Summary
Loads a collection of scripts. Here are two methods to load scripts.
- A simple array of urls [ "script.js", "script2.js" ]
- An array of dictionaries [ { MyObject: "myObjectScript.js" } ]. In this case the function will test if the script is already loaded by using the key of the dictionary as object name.
Parameters:
-
scriptsArrayAn array of urls or an array of dictionaries as described above
-
[options]Object optionalA dictionary of parameters (ex. { "async": "true" }).
-
[successCallback]Function optionalA function to call when the script is loaded successfully.
-
[errorCallback]Function optionalA function to call if the process fails.
-
[interval]Number optionalTime to wait when checking all is loaded in the end.