AJAX - The onreadystatechange Property
The onreadystatechange Property
After sending a request to the web server, we need a function to receive the data returned from the server.
The onreadystatechange property stores the function that will process the response from a server. This function is stored in the property and is called automatically.
Syntax:-
xmlhttp.onreadystatechange=function()
{
// code here
}
source:http://www.botskool.com/programming-tutorials/ajax-tutorials/ajax-basic-tutorial