It’s necessary to write a function for creating new
XMLHTTPRequest objects because Microsoft
browsers use two different methods of creating them, while all other
major browsers use a third. By writing a function to test the browser
in use, you can ensure that your code will work on all major
The purpose of the
try...catch construct is to set an error
trap for the code inside the
statement. If the code causes an error, the
catch section will be executed instead of a
general error being issued.
You can tell that an Ajax call has completed when the
readyState property of an object has a value
When an Ajax call successfully completes, the object’s
status property will have a value of
responseText property of
XMLHTTPRequest object contains
the value returned by a successful Ajax call.
responseXML property of
XMLHTTPRequest object contains a
DOM tree created from the XML returned by a successful Ajax
To specify a callback function to handle Ajax responses, assign
the function name to the
onreadystatechange property. You can also
use an unnamed, inline function.
To initiate an Ajax request, an
send method is called.
The main differences between Ajax
POST requests are that
GET requests append the data to the URL,
POST requests instead pass
the data as a parameter of the
send method and ...