AJAX XMLHttpRequest readyState
XMLHttpRequest object can be used to exchange data with a web server behind the scenes. This means that it is possible to update parts of a web page, without reloading the whole page.
XMLHttpRequest object make a request to the server it goes through process of cycle till it get response.
XMLHttpRequest is responsible for request/readyState using onreadystatechange property which triggers or fires a event as readyState changes.
XMLHttpRequest object has various properties like
Let's check it out XMLHttpRequest object properties in detailed way.
|onreadystatechange||Defines a function to be called when the readyState property changes|
|readyState||Holds the status of the XMLHttpRequest.
0: request not initialized
1: server connection established
2: request received
3: processing request
4: request finished and response is ready
|responseText||Returns the response data as a string|
|responseXML||Returns the response data as XML data|
|status||Returns the status-number of a request
404: "Not Found"
|statusText||Returns the status-text (e.g. "OK" or "Not Found")|