The XMLHttpRequest
method open()
initializes a newly-created request, or re-initializes an existing one.
open()
has already been called) is the equivalent of calling abort()
.XMLHttpRequest.open(method, url) XMLHttpRequest.open(method, url, async) XMLHttpRequest.open(method, url, async, user) XMLHttpRequest.open(method, url, async, user, password)
method
"GET"
, "POST"
, "PUT"
, "DELETE"
, etc. Ignored for non-HTTP(S) URLs.url
DOMString
representing the URL to send the request to.async
Optional
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. Worker
s.user
Optional
null
value.password
Optional
null
value.Specification | Status | Comment |
---|---|---|
XMLHttpRequest The definition of 'open()' in that specification. | Living Standard | WHATWG living standard |
Desktop | ||||||
---|---|---|---|---|---|---|
Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | |
Basic support | 1 | 12 | Yes
|
7
|
Yes | 1.2 |
Mobile | |||||||
---|---|---|---|---|---|---|---|
Android webview | Chrome for Android | Edge Mobile | Firefox for Android | Opera for Android | iOS Safari | Samsung Internet | |
Basic support | Yes | 18 | Yes | Yes
|
Yes | Yes | Yes |
XMLHttpRequest
methods: setRequestHeader()
,send()
, and abort()
© 2005–2018 Mozilla Developer Network and individual contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/open