Copyright © 2007. All rights reserved.
This document specifies XMLHttpRequest as it is made available within the Joost™ client.
Any and all use of the Joost API is subject to the Joost API Terms of Use
The API may change and although we will try and keep these changes to a minimum, some API calls may be deprecated in the future.
This API is the same as the one provided in most Web browsers and described in the XMLHttpRequest [XHR] specification but with a few minor modifications made either for security reasons or for convenience:
send(null) instead of
simply send() when they wish to send no data. We wrap this method
in order to work around that issue.
The API description below lists the methods and fields mostly in order to flag the points in which it differs from the original. For more details please refer to the full specification.
The XMLHttpRequest interface
interface XMLHttpRequest { attribute EventListener onreadystatechange; readonly attribute Number readyState; void open(in String method, in String url) raises(Exception); void open(in String method, in String url, in boolean async) raises(Exception); void open(in String method, in String url, in boolean async, in String user) raises(Exception); void open(in String method, in String url, in boolean async, in String user, in String password) raises(Exception); void setRequestHeader(in String header, in String value) raises(Exception); void overrideMimeType(in String mimeType); void send(); void send(in Document data); void send(in String data); void abort(); String getAllResponseHeaders(); String getResponseHeader(in String header); readonly attribute String responseText; readonly attribute Document responseXML; readonly attribute Number status; readonly attribute String statusText; };
onreadystatechange
of type
EventListenerThis attribute behaves exactly the same as the one in the original specification [XHR].
readyState
of type
Number, readonlyThis attribute behaves exactly the same as the one in the original specification [XHR].
responseText
of type
String, readonlyThis attribute behaves exactly the same as the one in the original specification [XHR].
responseXML
of type
Document, readonlyThis attribute behaves exactly the same as the one in the original specification [XHR].
status
of type
Number, readonlyThis attribute behaves exactly the same as the one in the original specification [XHR].
statusText
of type
String, readonlyThis attribute behaves exactly the same as the one in the original specification [XHR].
abortThis method behaves exactly the same as the one found in the original specification [XHR].
getAllResponseHeadersThis method behaves exactly the same as the one found in the original specification [XHR].
| All headers as a string. |
getResponseHeaderThis method behaves exactly the same as the one found in the original specification [XHR].
header
of type
String | The header value. |
openThis method is different from the original specification [XHR] in the following regards:
async is set to a value other than true
a SECURITY_ERR will be raised.
url is a relative reference, or uses a scheme other than http,
a SYNTAX_ERR will be raised.
SYNTAX_ERR when
encountering it.
SECURITY_ERR exception to be raised.
method
of type
Stringurl
of type
Stringasync
of type
boolean, optionaltrue, which is also the default.
user
of type
String, optionalpassword
of type
String, optional| Exception |
Either of |
overrideMimeTypeThis method is not in the original specification [XHR], but is supported in several browser implementations.
It will cause Joost to use the given media type instead of the one sent with the response. This can be useful in order to obtain XML out of misconfigured servers.
mimeType
of type
StringsendThis method behaves exactly the same as the one found in the original specification [XHR].
The only part that distinguishes it from the send() method used in Gecko
is that it accepts the absence of an argument as equivalent to null.
data
of varying types (see IDL)
, optionalsetRequestHeaderThis method is different from the original specification [XHR] in the following regards:
header
of type
Stringvalue
of type
String| Exception |
Either of |