public class XMLHttpRequest extends SimpleScriptable
| Modifier and Type | Field and Description |
|---|---|
static int |
STATE_COMPLETED
All the data has been received; the complete data is available in responseBody and responseText.
|
static int |
STATE_INTERACTIVE
Some data has been received.
|
static int |
STATE_LOADED
The send() method has been called, but the status and headers are not yet available.
|
static int |
STATE_LOADING
The object has been created, but the send() method has not been called.
|
static int |
STATE_UNINITIALIZED
The object has been created, but not initialized (the open() method has not been called).
|
| Constructor and Description |
|---|
XMLHttpRequest()
Creates a new instance.
|
| Modifier and Type | Method and Description |
|---|---|
void |
jsConstructor()
Javascript constructor.
|
void |
jsxFunction_abort()
Cancels the current HTTP request.
|
String |
jsxFunction_getAllResponseHeaders()
Returns the labels and values of all the HTTP headers.
|
String |
jsxFunction_getResponseHeader(String headerName)
Retrieves the value of an HTTP header from the response body.
|
void |
jsxFunction_open(String method,
String url,
boolean async,
String user,
String password)
Assigns the destination URL, method and other optional attributes of a pending request.
|
void |
jsxFunction_overrideMimeType(String mimeType)
Override the mime type returned by the server (if any).
|
void |
jsxFunction_send(Object content)
Sends the specified content to the server in an HTTP request and receives the response.
|
void |
jsxFunction_setRequestHeader(String name,
String value)
Sets the specified header to the specified value.
|
org.mozilla.javascript.Function |
jsxGet_onreadystatechange()
Returns the event handler that fires on every state change.
|
int |
jsxGet_readyState()
Returns the current state of the HTTP request.
|
String |
jsxGet_responseText()
Returns a string version of the data retrieved from the server.
|
Object |
jsxGet_responseXML()
Returns a DOM-compatible document object version of the data retrieved from the server.
|
int |
jsxGet_status()
Returns the numeric status returned by the server, such as 404 for "Not Found"
or 200 for "OK".
|
String |
jsxGet_statusText()
Returns the string message accompanying the status code, such as "Not Found" or "OK".
|
void |
jsxSet_onreadystatechange(org.mozilla.javascript.Function stateChangeHandler)
Sets the event handler that fires on every state change.
|
get, getBooleanArg, getClassName, getDefaultValue, getDomNodeOrDie, getDomNodeOrNull, getIntArg, getLog, getObjectArg, getPrototype, getScriptableFor, getStartingScope, getStringArg, getTransformerScriptableFor, getWindow, getWindow, getWithPreemption, makeScriptableFor, setDomNode, setDomNode, setHtmlElementassociateValue, callMethod, callMethod, defineClass, defineClass, defineClass, defineConst, defineConstProperty, defineFunctionProperties, defineProperty, defineProperty, defineProperty, defineProperty, delete, delete, deleteProperty, deleteProperty, equivalentValues, get, getAllIds, getAssociatedValue, getAttributes, getAttributes, getAttributes, getAttributes, getClassPrototype, getDefaultValue, getFunctionPrototype, getGetterOrSetter, getIds, getObjectPrototype, getParentScope, getProperty, getProperty, getPropertyIds, getPrototype, getTopLevelScope, getTopScopeValue, has, has, hasInstance, hasProperty, hasProperty, isConst, isSealed, put, put, putConst, putConstProperty, putProperty, putProperty, redefineProperty, sealObject, setAttributes, setAttributes, setAttributes, setAttributes, setGetterOrSetter, setParentScope, setPrototypepublic static final int STATE_UNINITIALIZED
public static final int STATE_LOADING
public static final int STATE_LOADED
public static final int STATE_INTERACTIVE
public static final int STATE_COMPLETED
public XMLHttpRequest()
public void jsConstructor()
public org.mozilla.javascript.Function jsxGet_onreadystatechange()
public void jsxSet_onreadystatechange(org.mozilla.javascript.Function stateChangeHandler)
stateChangeHandler - The event handler that fires on every state change.public int jsxGet_readyState()
public String jsxGet_responseText()
public Object jsxGet_responseXML()
public int jsxGet_status()
public String jsxGet_statusText()
public void jsxFunction_abort()
public String jsxFunction_getAllResponseHeaders()
public String jsxFunction_getResponseHeader(String headerName)
headerName - The (case-insensitive) name of the header to retrieve.public void jsxFunction_open(String method, String url, boolean async, String user, String password)
method - The method to use to send the request to the server (GET, POST, etc).url - The url to send the request to.async - Whether or not to send the request to the server asynchronously.user - If authentication is needed for the specified URL, the username to use to authenticate.password - If authentication is needed for the specified URL, the password to use to authenticate.public void jsxFunction_send(Object content)
content - The body of the message being sent with the request.public void jsxFunction_setRequestHeader(String name, String value)
name - The name of the header being set.value - The value of the header being set.public void jsxFunction_overrideMimeType(String mimeType)
mimeType - the type used to override that returned by the server (if any)Copyright © 2002-2012 Gargoyle Software Inc.. All Rights Reserved.