readyState=0This stae is used, after you have created the
XMLHttpRequest object, but before you have called the open()
method. readyState=1 This state is used, after you have called the open()
method, but before you have called send().
readyState=2This state is used, after you have called send().
readyState=3 This state is used,after the browser has established a
communication with the server, but before the server has
completed the response.
readyState=4 This state is used,after the request has been completed, and
the response data have been completely received from the server.
Note:
Different browsers treat as ready state differently. Don't
expect all browsers to report all states eqally. Some will not report 1
and 0.
For Your AJAX web applications you will actually only be
interested state 4. That is when the request is completed and it
is safe use the received data
|