Class XMLHttpRequestWrapper
Object
|
+--XMLHttpRequestWrapper
- class
XMLHttpRequestWrapper
Defined in eh.js
|
Constructor Summary |
XMLHttpRequestWrapper()
The XMLHttpRequestWrapper class encapsulates the cross-browser
complexity in creating an XMLHttpRequest object and wraps the
XMLHttpRequest object into a JavaScript object.
|
xmlhttp
Object xmlhttp
XMLHttpRequestWrapper
XMLHttpRequestWrapper()
The XMLHttpRequestWrapper class encapsulates the cross-browser
complexity in creating an XMLHttpRequest object and wraps the
XMLHttpRequest object into a JavaScript object. The XMLHttpRequest
object returned by Internet Explorer cannot be used as a JavaScript
object and it is, therefore, hard to use the bare bone object.
This is a low level class, thus you should consider using
HttpAsynchRpc.
The XMLHttpRequestWrapper object supports the following functions
and attributes, which are all identical to the XMLHttpRequest
functions and attributes, except for onreadystatechange:
- F getResponseHeader
- F getResponseText
- F getRresponseXML
- F open
- F send
- F onreadystatechange
- A status
The onreadystatechange function, which must be added by the user if
using asynchronous RPC, gets the readyState as argument. The
readyState is an attribute of the original XMLHttpRequest object.
onreadystatechange(readyState)
readyState:
1 Loading Preparing to read the XML file. Did not try yet.
2 Loaded Reading and parsing the XML file.
Object model still not available.
3 Interactive Part of the XML file successfully parsed and read in.
Object model partially available for read only.
4 Completed Loading of the XML file has been completed,
successfully or unsuccessfully.
The status attribute is the status code returned by the server.
This status code is -1 if the XMLHttpRequest failed; for example,
if the XMLHttpRequest call could not contact the server.
Error range 1000 - 1049
Throws:- 1000: No XMLHttpRequest support in browser
abort
void abort()
getResponseHeader
Object getResponseHeader(header)
Throws:- 1001: XMLHttpRequestWrapper::getResponseHeader
getResponseText
Object getResponseText()
Throws:- 1002: XMLHttpRequestWrapper::getResponseText
getRresponseXML
Object getRresponseXML()
Throws:- 1003: XMLHttpRequestWrapper::getRresponseXML
open
void open(method , url)
Parameters:
method - must be a method supported by the server. Supported methods: GET, POST, HEAD, PUT, DELETE, OPTIONS etc
async - Whether the request is synchronous or asynchronous, i.e. whether send returns only after the response is received or if it returns immediately after sending the request. In the latter case, notification of completion is sent through onreadystatechange.
user - optional user name
password - optional user password
Throws:- 1004: XMLHttpRequestWrapper::open
send
void send(data)
Throws:- 1006: XMLHttpRequestWrapper::send
setRequestHeader
void setRequestHeader(header,value)
Throws:- 1005: XMLHttpRequestWrapper::setRequestHeader
Documentation generated by
JSDoc on Tue Feb 14 15:31:34 2012