AJAX is a developer's dream, because you can: Update a web page without reloading the page Request data from a server - after the page has loaded Receive data from a server - after the page has loaded Send data to a server - in the background
The onreadystatechange Property The readyState property holds the status of the XMLHttpRequest. The onreadystatechange property defines a function to be executed when the readyState changes. The status property and the statusText property holds the status of the XMLHttpRequest object.
Simple Examples A simple AJAX example Create a simple XMLHttpRequest, and retrieve data from a TXT file. An AJAX example with a callback function Create a XMLHttpRequest with a callback function, and retrieve data from a TXT file.