AJAX
AJAX
XMLHttpRequest
objects are used to interact with servers
This enables a Web page to update just part of a page without disrupting what the
user is doing.
Despite its name, XMLHttpRequest can be used to retrieve any type of data, not just
XML.
Constructor
The constructor initializes an
XMLHttpRequest() XMLHttpRequest . It must be called
before any other method calls.
The XMLHttpRequest() constructor creates a new XMLHttpRequest .
AJAX 1
Syntax
new XMLHttpRequest()
Return value
A new XMLHttpRequest object.
The object must be prepared by at least calling open() to initialize it before
calling send() to send the request to the server.
AJAX 2
XMLHttpRequest Object Properties
Property Description
The status property and the statusText properties hold the status of the
XMLHttpRequest object.
Property Description
AJAX 3
The onreadystatechange function is called every time the readyState changes.
When readyState is 4 and status is 200, the response is ready:
AJAX 4