ScriptLoader - Client
-
- UpdatedAug 3, 2023
- 1 minute read
- Vancouver
- API reference
The Vancouver release is no longer supported. As such, the product documentation and release notes are provided for informational purposes only, and will not be updated.
Provides the ability to load scripts asynchronously.
You can use the ScriptLoader API in client-side scripts for a platform/desktop UI using ListV2 and ListV3 APIs. It is not available for Service Portal, Mobile, or Agent Workspace.
You access the ScriptLoader methods by using the global object ScriptLoader.
ScriptLoader - getScripts(Array scripts, Function callback)
Loads scripts asynchronously.
Name | Type | Description |
---|---|---|
scripts | Array | Array of scripts to load. |
callback | Function | Function to call when the scripts have been loaded. The callback function must not have any arguments. |
Type | Description |
---|---|
void |
Example
ScriptLoader - getScripts(String filePath, Function callback)
Gets scripts asynchronously.
Name | Type | Description |
---|---|---|
filePath | String | Path, including the file name, that contains one or more scripts. |
callback | Function | Function to call after the scripts have been loaded. This callback function should not have arguments. |
Type | Description |
---|---|
void |
Example
This example shows how load a utility script and then run the getDepartment() function.