XMLHttpRequest object
Object Methods
Common XMLHttpRequest Object Methods
Method | Description |
---|---|
abort() |
Stops the current request |
getAllResponseHeaders() |
Returns complete set of headers (labels and values) as a string |
getResponseHeader("headerLabel") |
Returns the string value of a single header label |
open("method", "URL"[, asyncFlag[, "userName"[, "password"]]]) |
Assigns destination URL, method, and other optional attributes of a pending request |
send(content) |
Transmits the request, optionally with postable string or DOM object data |
setRequestHeader("label", "value") |
Assigns a label/value pair to the header to be sent with a request |
Object Properties
Common XMLHttpRequest Object Properties
Property | Description |
---|---|
onreadystatechange |
Event handler for an event that fires at every state change |
readyState |
Object status integer: 0 = uninitialized 1 = loading 2 = loaded 3 = interactive 4 = complete |
responseText |
String version of data returned from server process |
responseXML |
DOM-compatible document object of data returned from server process |
status |
Numeric code returned by server, such as 404 for "Not Found" or 200 for "OK" |
statusText |
String message accompanying the status code |