ebs.injectKnownScriptAsync
Asynchronously injects a known JavaScript file.
Currently, the Plotly JavaScript Open Source Graphing Library is the only known script available. More known JavaScript files may be added in the future.
The function works by inserting a <script src="..."> </script> element in the form's HTML code.
Syntax
Copy
function ebs.injectKnownScriptAsync(name: KnownInjectScripts): Promise<void>
| Parameter | Type | Description |
|---|---|---|
name
|
KnownInjectScripts | Use "plotly" to import the Plotly JavaScript Open Source Graphing Library. |
Response
Returns a void promise object, allowing you to associate handlers in case of success or failure.
Examples
In this example:
- We import the Plotly JavaScript Open Source Graphing Library to a form.
- If the import is successful, we log a success message in the browser console.
Copy
ebs.injectKnownScriptAsync('plotly')
.then(console.log('Plotly loaded successfully.'))