shared
utils
string
object
is
extension
js
tracking
string
dom
when
selection
position
iframe
event
scroll
console
node
string
project
fs
console
whenScriptLoaded
Type:Function
Status:stable
Since:1.0.0
Platform:js
@blackbyte.sugar.js.dom.when
Detect when a script has been fully loaded
Params
- $script*-HTMLScriptElement
The script element to detect the loading state
- cbnullFunction
A callback if you prefer
Return
- -Promise
The promise that will be resolved when the script is fully loaded
Example
import { whenScriptLoaded } from '@blackbyte/sugar/dom'
whenScriptLoaded($script).then(($script) => {
// do something here
})Todo
- testsnormal
Author
- Olivier Bosselolivier.bossel@gmail.comhttps://blackbyte.space