@frankhoodbs/js-loader-cmp
v5.0.0
Published
JS Loader Component
Downloads
197
Keywords
Readme
JS Loader component
This is a component that loads Javascript code dynamically creating a script tag.
API Reference
Props
| Name | Type | Description |
|:-------------------|:----------|:----------------------------------------------------------------------------------------------------------------------------------------------------|
| data-src | string | Required. The source URL of the script to be loaded |
| data-async | string | Determines whether the script should be loaded asynchronously. Accepts only 'true' or 'false', defaults to 'true' |
| data-defer | boolean | Determines whether the script execution should be deferred until the page has finished parsing. Accepts only 'true' or 'false', defaults to 'false' |
| data-type | boolean | The MIME type of the script, defaults to 'text/javascript' |
| data-id | boolean | An optional ID for the script tag |
| data-extra-attrs | boolean | Any extra attributes to be added to the script tag in a JSON string format, defaults to '{}' |
Usage/Examples
<js-loader-cmp
data-src="https://www.youtube.com/iframe_api"
data-async="true"
data-defer="true"
/>