The XMLHttpRequest Object
Examples
Load a
textfile into a div element with XML HTTP
Make a
HEAD request with XML HTTP
Make a
specified HEAD request with XML HTTP
List data from an XML file with XML HTTP
The XMLHttpRequest Object Reference
Methods
| Method |
Description |
| abort() |
Cancels the current request |
| getAllResponseHeaders() |
Returns the complete set of http headers as a string |
| getResponseHeader("headername") |
Returns the value of the specified http header |
| open("method","URL",async,"uname","pswd") |
Specifies the method, URL, and other optional attributes of a
request The method parameter can have a value of "GET", "POST",
or "PUT" (use "GET" when requesting data and use "POST"
when sending data (especially if the length of the data is
greater than 512 bytes.
The URL parameter may be either a relative or
complete URL.
The async parameter specifies
whether the request should be handled asynchronously or not. true means
that script
processing carries on after the send() method, without waiting for a response. false
means that the script waits for a response before continuing script
processing |
| send(content) |
Sends the request |
| setRequestHeader("label","value") |
Adds a label/value pair to the http header to be sent |
Properties
| Property |
Description |
| onreadystatechange |
An event handler for an event that fires at every state change |
| readyState |
Returns the state of the object: 0 = uninitialized
1 = loading
2 = loaded
3 = interactive
4 = complete |
| responseText |
Returns the response as a string |
| responseXML |
Returns the response as XML. This property returns an XML document
object, which can be examined and parsed using W3C DOM node tree methods and
properties |
| status |
Returns the status as a number (e.g. 404 for "Not Found" or 200 for
"OK") |
| statusText |
Returns the status as a string (e.g. "Not Found" or
"OK") |
Whether you're new to XML or already an advanced user, the user-friendly views
and powerful entry helpers, wizards, and debuggers in XMLSpy are designed to
meet your XML and Web services development needs from start to finish.
- XML editor
- Graphical XML Schema / DTD editors
- XSLT 1.0/2.0 editor, debugger, profiler
- XQuery editor, debugger, profiler
- Support for Office Open XML (OOXML)
- Graphical WSDL editor & SOAP debugger
- Java, C#, C++ code generation
- And much more!
Download a free 30-day trial today!
Click to see a demo!
Learn what’s new in v2008
 |
|
Get Your Diploma!
W3Schools' Online Certification Program is the perfect solution for busy
professionals who need to balance work, family, and career building.
The HTML Certificate is for developers who want to document their knowledge of HTML, XHTML, and CSS.
The ASP Certificate is for developers who want to document their knowledge of ASP, SQL, and ADO.
|
|