XMLHttpRequest: XMLHttpRequest() constructor - Web APIs | MDN
Syntax
js
new XMLHttpRequest()
// Non-standard
new XMLHttpRequest(options)
Parameters
There are no standard parameters. However, Firefox allows a non-standard parameter:
optionsNon-standard-
An object that can contain the following flags:
mozAnon-
A boolean. When setting this flag to
truewill 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 usingsetRequestHeader. mozSystem-
A boolean. When setting this flag to
true, the same origin policy will not be enforced on the request.
Return value
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.
Specifications
| Specification |
|---|
| XMLHttpRequest # dom-xmlhttprequest |