Function: require()
ts
function require(file, callback): void;Dynamically load a JavaScript file and execute a callback function.
Parameters
| Parameter | Type | Description |
|---|---|---|
file | string | The URL of the JavaScript file to load. |
callback | (ev) => any | The callback function to execute when the script is loaded. |
Returns
void
Example
ts
requireScript('path/to/script.js', () => {
console.log('Script loaded');
});Since
1.0.0