Parameters

An optional Boolean parameter, defaulting to true, indicating whether or not to perform the operation asynchronously. If this value is false, the send() method does not return until the response is received. If true, notification of a completed transaction is provided using event listeners. This must be true if the multipart attribute is true, or an exception will be thrown.

Note: Synchronous requests on the main thread can be easily disruptive to the user experience and should be avoided; in fact, many browsers have deprecated synchronous XHR support on the main thread entirely. Synchronous requests are permitted in Workers.

userOptional

The optional user name to use for authentication purposes; by default, this is the null value.

passwordOptional

The optional password to use for authentication purposes; by default, this is the null value.

Notes Starting in Firefox 30, synchronous requests on the main thread have been deprecated due to their negative impact on performance and the user experience. Therefore, the async parameter may not be false except in a Worker.

IEFull support
7

Full support
7

Full support
5

Notes

Notes Implemented via ActiveXObject

OperaFull support
Yes

SafariFull support
1.2

WebView AndroidFull support
Yes

Chrome AndroidFull support
18

Edge MobileFull support
Yes

Firefox AndroidFull support
Yes

Notes

Full support
Yes

Notes

Notes Starting in Firefox 30, synchronous requests on the main thread have been deprecated due to their negative impact on performance and the user experience. Therefore, the async parameter may not be false except in a Worker.