Custom Search

What are the properties of the XmlHttpRequest object? What are the different types of readyStates in Ajax?

i) onreadyStateChange - This function is used to process the reply from the web server.

ii) readyState - This property holds the response status of the web server. There are 5 states:

0 - request not yet initialized

1 - request now set

2 - request sent

3 - request processing

4 - request completes

iii) responseText - Has the data sent back by the web server

Code snippet below shows an example how these there properties are used to implement ajax :
xmlHttpObject.onreadystatechange=function()
{
if(xmlHttpObject.readyState==4)
{
document.Form1.time.value=xmlHttpObject.responseText;
}
}
Your Ad Here