API Docs for: 2.7.3
Show:

API.html Class

Module: API
Parent Module: Wanaplan

API for Wanaplan html helpers.

Constructor

API.html

()

Item Index

Methods

addCSS

(
  • url
  • success
  • fail
)

Adds a CSS stylesheet to the document.

Parameters:

  • url String

    The url of the css file to load.

  • success Function

    A function called if the operation is completed successfully.

  • fail Function

    A function called if the operation fails.

addHTML

(
  • url
  • domElement
  • success
  • fail
)

Loads and adds an HTMLElement to the document.

Parameters:

  • url String

    The url of the HTML element to load.

  • domElement HTMLElement

    An instance of a DOM element.

  • success Function

    A function called if the operation is completed successfully.

  • fail Function

    A function called if the operation fails.

addScript

(
  • url
  • success
  • fail
)

Loads a script in the document.

Parameters:

  • url String

    The url of the script to load.

  • success Function

    A function called if the operation is completed successfully.

  • fail Function

    A function called if the operation fails.

addScripts

(
  • scripts
  • [options]
  • [successCallback]
  • [errorCallback]
  • [interval]
)

Loads a collection of scripts. Here are two methods to load scripts.

  1. A simple array of urls [ "script.js", "script2.js" ]
  2. 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:

  • scripts Array

    An array of urls or an array of dictionaries as described above

  • [options] Object optional

    A dictionary of parameters (ex. { "async": "true" }).

  • [successCallback] Function optional

    A function to call when the script is loaded successfully.

  • [errorCallback] Function optional

    A function to call if the process fails.

  • [interval] Number optional

    Time to wait when checking all is loaded in the end.