Appendix A. XMLHttpRequest Reference
This Appendix assembles all methods
and properties that the XMLHttpRequest
object exposes. Square brackets []
denote an array; parentheses ()
indicate a method.
To create an XMLHttpRequest
object for Internet Explorer, you must use ActiveX:
XMLHTTP = new ActiveXObject("Microsoft.XMLHTTP");
With other browsers, the XMLHttpRequest
object is a built-in type and can be instantiated directly, as in the following snippet:
XMLHTTP = new XMLHttpRequest();
Once the XMLHttpRequest
object is instantiated, the following cross-browser methods and properties are supported:.
Methods
Method |
Description |
---|---|
|
Aborts the request |
|
Returns all headers of the HTTP response |
|
Returns the value of the given HTTP response header |
|
Creates an HTTP request with the given method (GET or POST) to the given URL. The other parameters are optional: whether to use an asynchronous call (default) or not, and credentials for HTTP Authentication |
|
Sends the HTTP request, optionally providing data to send with it (POST information) |
|
Adds a header with the given name and value to the HTTP request |
Get Programming Atlas now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.