active()
- Print
active()
- Print
Article summary
Did you find this summary helpful?
Thank you for your feedback
active()
A portion of the X1 JavaScript API is loaded asynchronously. The active method, when combined with the onMoneyBadgerReady event listener, will allow you to ensure that calls to the X1 JavaScript API succeed during this window without blocking your own X1 App code.
Signature:
$badger.active()
Parameters:
None.
Return Values:
Description | Type | Result |
---|---|---|
The X1 JavaScript API is ready (fully initialized) | boolean | true |
The X1 JavaScript API is not ready (not fully initialized) | boolean | false |
Usage Example:
if ($badger && $badger.active()) {
// use the X1 JavaScript API
} else {
document.addEventListener('onMoneyBadgerReady', () => {
// use the X1 JavaScript API
})
}
Was this article helpful?