ajax(opt, success, failure)

ajax allows you to make various http or https requests. See ajaxOptions
Name Type Description
opt ajaxOptions Options specifying the type of ajax request to make.
success function The success handler that is called when a HTTP 200 response is given.
failure function The failure handler when the HTTP request fails or is not 200.


Loads external dependencies, allowing you to write a multi-file project. Package loading loosely follows the CommonJS format. Exporting is possible by modifying or setting module.exports within the required file. The module path is also available as module.path. This currently only supports a relative path to another JavaScript file.
Name Type Description
path string The path to the dependency.

Type Definitions


ajax options. There are various properties with url being the only required property.
Name Type Argument Default Description
method string <optional>
'get' The HTTP method to use: 'get', 'post', 'put', 'delete', 'options', or any other standard method supported by the running environment.
url string The URL to make the ajax request to. e.g. ''
type string <optional>
'text' The expected response format. Specify 'json' to have ajax parse the response as json and pass an object as the data parameter.
data object <optional>
The request body, mainly to be used in combination with 'post' or 'put'. e.g. { username: 'guest' }
headers object Custom HTTP headers. Specify additional headers. e.g. { 'x-extra': 'Extra Header' }
async boolean <optional>
true Whether the request will be asynchronous. Specify false for a blocking, synchronous request.
cache boolean <optional>
true Whether the result may be cached. Specify false to use the internal cache buster which appends the URL with the query parameter _ set to the current time in milliseconds.