Namespace to hold the Jaxer client-side cross-browser wrapper around XMLHttpRequest.
Platform Support
Jaxer Server Framework | Jaxer Client Framework | 1.0 | 1.0 |
---|
Properties
![]() |
|||
Property | Action | Jaxer Server Framework | Jaxer Client Framework |
---|---|---|---|
The value of the "reason" property that indicates a communication failure has occurred. This property is set on the Error
object that's thrown by XHR.send() during synchronous requests that don't use the onsuccess function but rather just return
a response or throw an Error.
(Advanced) |
No Details | 1.0 | 1.0 |
|
|||
The value of the "reason" property that indicates a timeout has occurred. This property is set on the Error object that's
thrown by XHR.send() during synchronous requests that don't use the onsuccess function but rather just return a response or
throw an Error.
(Advanced) |
No Details | 1.0 | 1.0 |
|
|||
The default SendOptions which new calls to Jaxer.XHR.send(message, options, extra) will use, unless overridden by the options
argument. This is slightly different for client-side and server-side requests (e.g. server-side requests are by default synchronous).
|
No Details | 1.0 | 1.0 |
|
Functions
![]() |
||||||||||||||
Method | Action | Jaxer Server Framework | Jaxer Client Framework | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
static getTransport() : XMLHttpRequest
Returns an XMLHttpRequest object by calling the platform-specific API for it. On the server side of Jaxer, the XPCOM version
of XMLHttpRequest is used.
(Advanced) |
Show Details | 1.0 | 1.0 | |||||||||||
Returns
|
||||||||||||||
static onfailure(Object error, Object extra, XMLHttpRequest xhr) :
void
The default client-side function used to handle any errors that occur during XMLHttpRequest processing by throwing an error
describing them
(Advanced) |
Show Details | 1.0 | 1.0 | |||||||||||
Parameters
|
||||||||||||||
static ontimeout(Error timeout, Object extra, XMLHttpRequest xhr) :
void
The default client-side function used to handle any timeout errors that occur during XMLHttpRequest processing by throwing
an error describing them
(Advanced) |
Show Details | 1.0 | 1.0 | |||||||||||
Parameters
|
||||||||||||||
static testSuccess(XMLHttpRequest xhr) : Boolean
The default function used to test whether the XMLHttpRequest got a successful response or not, in particular using xhr.status,
location.protocol and some browser sniffing.
(Advanced) |
Show Details | 1.0 | 1.0 | |||||||||||
Parameters
Returns
|
||||||||||||||
static cancel(Number asyncKey) : Boolean
Cancels the pending async XMLHttpRequest if its response has not yet been received and if it has not yet timed out.
|
Show Details | 1.0 | 1.0 | |||||||||||
Parameters
Returns
|
||||||||||||||
static send(String message, Object options, Object extra) : Object
The generic function used to send requests via XMLHttpRequest objects. Each request gets its own XMLHttpRequest object, and
async requests hold onto that object until they're finished or timed out or canceled. On the server side of Jaxer, only synchronous
requests are supported.
For async requests, this returns a key that can be used to abort the request via Jaxer.XHR.cancel(). For synchronous requests, returns the response of the server or throws an exception if an error occurred, unless an onsuccess function was specified in the options, in which case it passes the response to that function and also handles any errors through the onfailure function if specified in the options. In any case, the response can be a text string or an XML DOM. To force one or the other, set the "as" property on the options argument, e.g. if as="text" it will definitely be a text string, if as="xml" it will definitely be an XML DOM, and if as="e4x" it will be an E4X DOM (if E4X is supported -- which is always the case server-side but may not be client-side). |
Show Details | 1.0 | 1.0 | |||||||||||
Parameters
Returns
|