/utils/scriptElement
The module exports a default method to load scripts from tags.
- Source
Methods
(async, inner) scriptElement(src, typeopt) → {Promise.<Event>}
The scriptElement method adds a promise to the promises object for a script src to be loaded.
An existing promise will be awaited.
The promise resolves with the load event.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
src | string | The script element src. | ||
type | string | <optional> | 'module' | The script type. |
- Source
Returns:
The promise resolves to the load event for the script element.
- Type:
- Promise.<Event>