Name
XMLHttpRequest: An HTTP request and response — Firefox 1.0, Internet Explorer 5.0, Safari 1.2, Opera 7.60: Object → XMLHttpRequest
Constructor
new XMLHttpRequest( ) // All browsers except IE 5 and IE 6
new ActiveXObject("Msxml2.XMLHTTP") // IE
new ActiveXObject("Microsoft.XMLHTTP") // IE with older system librariesProperties
-
readonly short readyState The state of the HTTP request. The value of this property begins at 0 when an XMLHttpRequest is first created and increases to 4 when the complete HTTP response has been received. Each of the five states has an informal name associated with it, and the table below lists the states, their names, and their meanings:
State
Name
Description
0Uninitialized
This is the initial state. The XMLHttpRequest object has just been created or has been reset with the
abort( )method.1Open
The
open( )method has been called, butsend( )has not. The request has not yet been sent.2Sent
The
send( )method has been called, and the HTTP request has been transmitted to the web server. No response has been received yet.3Receiving
All response headers have been received. The response body is being received but is not complete.
4Loaded
The HTTP response has been fully received.
The value of
readyStatenever decreases, unlessabort( )oropen( )are called on a request that is already in progress. Every time the value of this property increases, theonreadystatechangeevent handler is triggered.-
readonly String responseText ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access