XMLHttpRequest makes sending HTTP requests very easy. You simply create an instance of the object, open a URL, and send the request. The HTTP status of the result, as well as the result's contents, are available in the request object when the transation is completed.
Example: A synchronous request
XMLHttpRequest supports both synchronous and asynchronous communications. This example demonstrates how to make a simple synchronous request.
XMLHttpRequestsbecause they block the application's user interface.
var req = new XMLHttpRequest(); req.open('GET', 'http://www.mozilla.org/', false); req.send(null); if(req.status == 200) dump(req.responseText);