Object | +--AjaxRequest
| Field Summary | |
boolean |
aborted
An internal flag to indicate whether the request has been aborted |
boolean |
async
Whether or not the request will be asynchronous. |
boolean |
generateUniqueUrl
Since some browsers cache GET requests via XMLHttpRequest, an additional parameter called AjaxRequestUniqueId will be added to the request URI with a unique numeric value appended so that the requested URL will not be cached. |
string |
groupName
The name of the group that this request belongs to, for activity monitoring purposes |
string |
method
The method of the request, either GET (default), POST, or HEAD |
functionReference |
onComplete
A function reference assigned will be called when readyState=4 |
functionReference |
onError
A function reference assigned will be called after onComplete, if the statusCode != 200 |
functionReference |
onGroupBegin
If this request has a group name, this function reference will be called and passed the group name if this is the first request in the group to become active |
functionReference |
onGroupEnd
If this request has a group name, and this request is the last request in the group to complete, this function reference will be called |
functionReference |
onInteractive
A function reference assigned will be called when readyState=3 |
functionReference |
onLoaded
A function reference assigned will be called when readyState=2 |
functionReference |
onLoading
A function reference assigned will be called when readyState=1 |
functionReference |
onSuccess
A function reference assigned will be called after onComplete, if the statusCode=200 |
functionReference |
onTimeout
If a timeout period is set, and it is reached before a response is received, a function reference assigned to onTimeout will be called |
Object |
parameters
The parameters is an object holding name/value pairs which will be added to the url for a GET request or the request content for a POST request |
string |
password
The password used to access the URL |
string |
queryString
The query string to be added to the end of a GET request, in proper URIEncoded format |
<private> int |
requestIndex
The sequential index number of this request, updated internally |
<private> boolean |
responseReceived
Indicates whether a response has been received yet from the server |
string |
responseText
After a response has been received, this will hold the text contents of the response - even in case of error |
xmlNode |
responseXML
After a response has been received, this will hold the XML content |
int |
status
After a response has been received, this will hold the status code of the response as returned by the server. |
string |
statusText
After a response has been received, this will hold the text description of the response code |
int |
timeout
Timeout period (in ms) until an async request will be aborted, and the onTimeout function will be called |
string |
url
The url that the request will be made to, which defaults to the current url of the window |
string |
username
The username used to access the URL |
<private> XMLHttpRequest |
xmlHttpRequest
The XMLHttpRequest object used internally |
<static> Object |
numActiveAjaxGroupRequests
An object holding the number of active requests for each group |
<static> int |
numActiveAjaxRequests
The number of total AjaxRequest objects currently active and running |
<static> int |
numAjaxRequests
The total number of AjaxRequest objects instantiated |
| Constructor Summary | |
AjaxRequest
()
The AjaxRequest class is a wrapper for the XMLHttpRequest objects which are available in most modern browsers. |
|
| Method Summary | |
Object
|
getAllResponseHeaders()
Returns the results of XMLHttpRequest.getAllResponseHeaders(). |
string
|
getResponseHeader(<string> headerName)
Returns the the value of a response header as returned by XMLHttpRequest,getResponseHeader(). |
<private> void
|
handleArguments(<Object> args)
An internal function to handle an Object argument, which may contain either AjaxRequest field values or parameter name/values |
void
|
process()
The process method is called to actually make the request. |
<static> <private> void
|
doRequest(method,args)
The internal method used by the .get() and .post() methods |
<static> void
|
get(<Object> args)
Make a GET request. |
<static> Object
|
getXmlHttpRequest()
Returns an XMLHttpRequest object, either as a core object or an ActiveX implementation. |
<static> boolean
|
isActive()
See if any request is active in the background |
<static> void
|
post(<Object> args)
Make a POST request. |
<static> string
|
serializeForm(<FormReference> theform)
Serialize a form into a format which can be sent as a GET string or a POST content.It correctly ignores disabled fields, maintains order of the fields as in the elements[] array. |
<static> boolean
|
submit(<FormReference> theform, <Object> args)
Submit a form. |
| Field Detail |
boolean aborted
boolean async
boolean generateUniqueUrl
string groupName
string method
functionReference onComplete
functionReference onError
functionReference onGroupBegin
functionReference onGroupEnd
functionReference onInteractive
functionReference onLoaded
functionReference onLoading
functionReference onSuccess
functionReference onTimeout
Object parameters
string password
string queryString
<private> int requestIndex
<private> boolean responseReceived
string responseText
xmlNode responseXML
int status
string statusText
int timeout
string url
string username
<private> XMLHttpRequest xmlHttpRequest
<static> Object numActiveAjaxGroupRequests
<static> int numActiveAjaxRequests
<static> int numAjaxRequests
| Constructor Detail |
AjaxRequest()
| Method Detail |
Object getAllResponseHeaders()
string getResponseHeader(<string> headerName)
headerName - The name of the header whose value you want to retrieve
<private> void handleArguments(<Object> args)
args - The Object to handle
void process()
<static> <private> void doRequest(method,args)
<static> void get(<Object> args)
args - Arguments
<static> Object getXmlHttpRequest()
<static> boolean isActive()
<static> void post(<Object> args)
args - Arguments
<static> string serializeForm(<FormReference> theform)
theform - A reference to the form on the page to serialize, ex: document.forms[0]
<static> boolean submit(<FormReference> theform, <Object> args)
theform - A reference to the form on the page to submit, ex: document.forms[0]
args - Arguments