HOME  |  AJAX  |  SOLUTIONS  |  TECHNOLOGIES  |  E-COMMERCE  |  ABOUT US
XmlHttpRequest Properties
In addition to the 6 methods available via the XmlHttpRequest object, you also have access to 6 properties.
onreadystatechange
This property sets the method to be called on every state change.  This is usually your event handler for the asynchronous callback.
readyState
This property defines the state of the XmlHttpRequest.  Possible values include:

0      Uninitated
1      Loading
2      Loaded
3      Interactive
4      Complete

When sending the XmlHttpRequest, you will check to see if the readyState is 0 or 4, and in your asynchronous callback handler, you will check to see if the readyState is 4.
responseText
This returns the response from the server as a string.  If you are only returning one value this is the way to go because it is much easier that trying to walk the XML DOM.
responseXML
This returns the response from the server as an XML document.  This is the way to go if you need to return multiple values from your AJAX request.  It does require some knowledge of the XML DOM to use, but is quite powerful.
status
This returns the HTTP status code from the server such as 200 for OK or 404 for not found.
statusText
This returns a string representation of the HTTP status code such as OK for 200 and Not Found for 404

And that's is for the properties available to you via the XmlHttpRequest object.