Constructor
new Ajax(rootPath, options)
Parameters:
Name | Type | Description | ||||||
---|---|---|---|---|---|---|---|---|
rootPath |
string | |||||||
options |
Object |
Properties
|
Members
(static) crossOrigin
Allow cross-origin requests (CORS) for images.
Methods
_loadImage(url) → {Promise}
Loads image data at specified path which is returned in a Promise object.
Parameters:
Name | Type | Description |
---|---|---|
url |
string |
Path to whatever shall be loaded. |
_loadVideo(url, mimeType) → {Promise}
Loads video data at specified path which is returned in a Promise object.
Parameters:
Name | Type | Description |
---|---|---|
url |
string |
Path to whatever shall be loaded. |
mimeType |
string |
the mimeType of the video to load |
clear()
Clears the ajax cache
Is called by DynamicLoader.clear
get(options) → {Promise}
Uses GET to retrieve data at a remote location.
Parameters:
Name | Type | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object |
Properties
|
load(path, reloadopt) → {Promise}
Loads data at specified path which is returned in a Promise object.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
path |
string |
Path to whatever shall be loaded. |
||
reload |
boolean |
<optional> |
false |
If set to true, reloads even if url is cached |
prefill(bundle, clearopt)
Prefill ajax cache with data
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
bundle |
Object |
Pairs of key-configs |
||
clear |
boolean |
<optional> |
false |
If set to true will overwrite cache, otherwise extend it |