To create an instance of XMLHttpRequest, simply do this:
var req = new XMLHttpRequest();
For details about how to use XMLHttpRequest, see Using XMLHttpRequest.
Documentation for this class was provided by MDN. var onabort : EventListener var onerror : EventListener var onload : EventListener var onloadend : EventListener var onloadstart : EventListener var onprogress : EventListener var onreadystatechange : EventListener var readyState(default,null) : Int
The state of the request:
|0||UNSENT||open()has not been called yet.|
|1||OPENED||send()has not been called yet.|
|2||HEADERS_RECEIVED||send() has been called, and headers and status are available.|
|3||LOADING||Downloading; responseText holds partial data.|
|4||DONE||The operation is complete.|
Can be set to change the response type. This tells the server what format you want the response to be in.
|Value||Data type of response property|
|empty string||String (this is the default)|
The response to the request as a DOM Document object, or null if the request was unsuccessful, has not yet been sent, or cannot be parsed as XML. The response is parsed as if it were a text/xml stream. Read-only.
Indicates whether or not cross-site Access-Control requests should be made using credentials such as cookies or authorization headers. New in Firefox 3.5
The default is false.Setter throws DOMException. function new() : Void function abort() : Void function getAllResponseHeaders() : String function getResponseHeader( header : String ) : String function open( method : String, url : String, ?async : Bool, ?user : String, ?password : String ) : Void function overrideMimeType( override_ : String ) : Void function send( data : DOMFormData ) : Void
Sends the request. If the request is asynchronous (which is the default), this method returns as soon as the request is sent. If the request is synchronous, this method doesn't return until the response has arrived.
- This may be an nsIDocument, nsIInputStream, or a string (an nsISupportsString if called from native code) that is used to populate the body of a POST request. Starting with Gecko 1.9.2, you may also specify an DOMFile , and starting with Gecko 2.0 (Firefox 4 / Thunderbird 3.3 / SeaMonkey 2.1) you may also specify a FormData object.