Object that transfers data between a web client and a remote web server.
Platform Support
IE | Mozilla | Netscape | Opera | Safari | 7.0+ | 1.0+ | 7.0+ | no | no |
---|
Constructors
Constructor | Action | IE | Mozilla | Netscape | Opera | Safari | ||
---|---|---|---|---|---|---|---|---|
XMLHttpRequest Constructor() : XMLHttpRequest
Creates a new instance of an XMLHttpRequest object.
|
Show Details | 7.0+ | 1.0+ | 7.0+ | no | no | ||
XMLHttpRequest() : XMLHttpRequestCreates a new instance of an XMLHttpRequest object. Returns
|
Properties
Property | Action | IE | Mozilla | Netscape | Opera | Safari |
---|---|---|---|---|---|---|
onreadystatechange
: Function
Event handler that fires when readystate changes value. Default is null.
|
Show Details | 7.0+ | 1.0+ | 7.0+ | no | no |
|
||||||
readyState
: Number
Returns the current state of an object. Valid values are 0 = uninitialized, 1 = open, 2 = sent, 3 = receiving, 4 = loaded.
|
Show Details | 7.0+ | 1.0+ | 7.0+ | no | no |
|
||||||
responseText
: String
Response formatted as a string.
|
Show Details | 7.0+ | 1.0+ | 7.0+ | no | no |
|
||||||
Response formatted as an XML document.
|
No Details | 7.0+ | 1.0+ | 7.0+ | no | no |
|
||||||
status
: Number
Status of the Response. (e.g. 200 = "OK", 404 = "Not Found", etc.)
|
Show Details | 7.0+ | 1.0+ | 7.0+ | no | no |
|
||||||
statusText
: String
Response text corresonding to status (e.g. "OK", "Not Found", etc.)
|
Show Details | 7.0+ | 1.0+ | 7.0+ | no | no |
|
Functions
Method | Action | IE | Mozilla | Netscape | Opera | Safari | |||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
abort() : void
Cancels the current request.
|
Show Details | 7.0+ | 1.0+ | 7.0+ | no | no | |||||||||||||||||
Returns
|
|||||||||||||||||||||||
getAllResponseHeaders() : String
Returns all HTTP headers as a single string.
|
Show Details | 7.0+ | 1.0+ | 7.0+ | no | no | |||||||||||||||||
Returns
|
|||||||||||||||||||||||
getResponseHeader(String header) : String
Returns the value of the specified HTTP header.
|
Show Details | 7.0+ | 1.0+ | 7.0+ | no | no | |||||||||||||||||
Parameters
Returns
|
|||||||||||||||||||||||
open(String method, String uri, [Boolean async,] [String user,] [String password]) : void
Initializes the request with the specified parameters.
|
Show Details | 7.0+ | 1.0+ | 7.0+ | no | no | |||||||||||||||||
Parameters
Returns
|
|||||||||||||||||||||||
send(String, Document data) : void
Sends the request.
|
Show Details | 7.0+ | 1.0+ | 7.0+ | no | no | |||||||||||||||||
Parameters
Returns
|
|||||||||||||||||||||||
setRequestHeader(String, Document header, String, Document value) : void
Sets a header and a value for the request.
|
Show Details | 7.0+ | 1.0+ | 7.0+ | no | no | |||||||||||||||||
Parameters
Returns
|
Remarks
Although currently recognized by most browsers, the XMLHttpRequest object will be part of the HTML DOM Level 3 specification.
Availability
HTML DOM Level 3|W3C