Movatterモバイル変換


[0]ホーム

URL:


  1. Web
  2. Web APIs
  3. XMLHttpRequest
  4. XMLHttpRequest()

XMLHttpRequest: XMLHttpRequest() constructor

Baseline Widely available

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 inWeb Workers, except forService Workers.

TheXMLHttpRequest() constructorcreates a newXMLHttpRequest.

Syntax

js
new XMLHttpRequest()// Non-standardnew 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 totrue will cause the browser not to expose theorigin and user credentials when fetching resources. Most important, this means thatcookies will not be sent unless explicitly added usingsetRequestHeader.

mozSystem

A boolean. When setting this flag totrue, the same origin policy will not be enforced on the request.

Return value

A newXMLHttpRequest object. The object must be prepared by at leastcallingopen() to initialize it before callingsend() to send the request to the server.

Specifications

Specification
XMLHttpRequest
# dom-xmlhttprequest

Browser compatibility

See also

Help improve MDN

Learn how to contribute

This page was last modified on byMDN contributors.


[8]ページ先頭

©2009-2025 Movatter.jp