ReadonlyerrorError object when the request fails.
Event handler called when the request fails.
Event handler called when the request completes successfully.
ReadonlyreadyCurrent state of the request.
ReadonlyresultThe result value when the request succeeds.
The addEventListener() method of the EventTarget interface sets up a function that will be called whenever the specified event is delivered to the target.
Optionaloptions: boolean | AddEventListenerOptionsThe dispatchEvent() method of the EventTarget sends an Event to the object, (synchronously) invoking the affected event listeners in the appropriate order.
The removeEventListener() method of the EventTarget interface removes an event listener previously registered with EventTarget.addEventListener() from the target.
Optionaloptions: boolean | EventListenerOptionsPromise-like interface for handling success and error.
OptionalonSuccess: (value: any) => anyCallback invoked on success
OptionalonError: (reason: any) => anyCallback invoked on error
A Promise
DOMRequest represents an asynchronous operation in the KaiOS/B2G platform. It provides a promise-like interface for handling success and error callbacks.
Example