Get to know MDN better
This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.
Note: This feature is available in Web Workers, except for Service Workers.
The XMLHttpRequest() constructor creates a new XMLHttpRequest.
There are no standard parameters. However, Firefox allows a non-standard parameter:
optionsAn object that can contain the following flags:
mozAnonA boolean. When setting this flag to true will cause the browser not to expose the origin and user credentials when fetching resources. Most important, this means that cookies will not be sent unless explicitly added using setRequestHeader.
mozSystemA boolean. When setting this flag to true, the same origin policy will not be enforced on the request.
A new XMLHttpRequest object. The object must be prepared by at least calling open() to initialize it before calling send() to send the request to the server.
| XMLHttpRequest # dom-xmlhttprequest |
Enable JavaScript to view this browser compatibility table.
This page was last modified on Apr 7, 2025 by MDN contributors.
Your blueprint for a better internet.
Visit Mozilla Corporation’s not-for-profit parent, the Mozilla Foundation.
Portions of this content are ©1998–2026 by individual mozilla.org contributors. Content available under a Creative Commons license.