• Skip to main content
  • Select language
  • Skip to search
MDN Web Docs
  • Technologies
    • HTML
    • CSS
    • JavaScript
    • Graphics
    • HTTP
    • APIs / DOM
    • WebExtensions
    • MathML
  • References & Guides
    • Learn web development
    • Tutorials
    • References
    • Developer Guides
    • Accessibility
    • Game development
    • ...more docs
B2G OS
  1. MDN
  2. Archive of obsolete content
  3. B2G OS
  4. B2G OS APIs
  5. DOMRequest

DOMRequest

In This Article
  1. Properties
  2. Methods
  3. Example
  4. Specifications
  5. Browser compatibility
  6. See also

A DOMRequest object represents an ongoing operation. It provides callbacks that are called when the operation completes, as well as a reference to the operation's result. A DOM method that initiates an ongoing operation may return a DOMRequest object that you can use to monitor the progress of that operation.

Note: This feature is available in Web Workers.

Properties

DOMRequest.onsuccess
A callback handler called when the operation represented by the DOMRequest is completed.
DOMRequest.onerror
A callback handler that gets called when an error occurs while processing the operation.
DOMRequest.readyState
A string indicating whether or not the operation is finished running. Its value is either "done" or "pending".
DOMRequest.result
The operation's result.
DOMRequest.error
Error information, if any.

Methods

None.

Example

An example of using the onsuccess, onerror, result, and error properties of a DOMRequest object.

var pending = navigator.mozApps.install(manifestUrl);
pending.onsuccess = function () {
  // Save the App object that is returned
  var appRecord = this.result;
  alert('Installation successful!');
};
pending.onerror = function () {
  // Display the name of the error
  alert('Install failed, error: ' + this.error.name);
};

Specifications

Not currently part of any specification.

Browser compatibility

  • Desktop
  • Mobile
Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari
Basic support ? 13.0 (13.0) ? ? ?
Available in workers ? 41.0 (41.0) ? ? ?
Feature Android Chrome for Android Firefox Mobile (Gecko) IE Mobile Opera Mobile Safari Mobile
Basic support ? ? 13.0 (13.0) ? ? ?
Available in workers ? ? 41.0 (41.0) ? ? ?

See also

  • DOMCursor

Document Tags and Contributors

Tags: 
  • API
  • DOM
  • Interface
  • Non-standard
  • Reference
 Contributors to this page: chrisdavidmills, fscholz, teoli, jsx, kscarfone, Jeremie, ethertank, Sheppy, markg
 Last updated by: chrisdavidmills, Feb 27, 2017, 2:07:10 AM
See also
  1. Archive
  2. Related pages for DOM (Non-standard)
    1. DOMCursor