|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Object | +--AjaxRequest
The AjaxRequest object wraps an instance of XMLHttpRequest and provides
facilities for setting functions that are called before a request is made
and after a request returns. By default, AjaxRequest handles the server
response by simply calling eval(), passing to it the responseText from
the XMLHttpRequestObject, of course assuming that the response was
generated by Taconite on the server side and that running eval() will
update the web page.
Example Usage:
var ajaxRequest = new AjaxRequest("YOUR_URL");
ajaxRequest.addFormElements("form_element_id_attribute_value-or-form_dom_element");
ajaxRequest.sendRequest();
Defined in taconite-client.js
Constructor Summary | |
AjaxRequest(url)
Constructor for the AjaxRequest class. |
Method Summary | |
void
|
addFormElements(form)
Add all of the form elements under the specified form to the query string to be sent to the server as part of the Ajax request. |
void
|
addFormElementsById()
Add the values of the id'd form elements to the query string to be sent to the server as part of the Ajax request. |
void
|
addNamedFormElements()
Add the values of the named form elements to the query string to be sent to the server as part of the Ajax request. |
void
|
addNamedFormElementsByFormID()
Same as addNamedFormElements, except it will filter form elements by form's id. |
void
|
addNameValuePair(<String> name, <String> value)
Add the name/value pair to the query string. |
void
|
addPostRequest(func)
Add a function to the list of post request functions. |
void
|
addPreRequest(func)
Add a function to the list of pre request functions that will be called before the request is sent to the server. |
Object
|
getParser()
Return the parser that wil be used to parse the reponse to this request. |
Object
|
getPostRequest()
Return the post request function. |
Object
|
getQueryString()
Return the query string. |
Object
|
getXMLHttpRequestObject()
Return the instance of the XMLHttpRequest object wrapped by this object. |
Object
|
isEchoDebugInfo()
Indicate if debugging is enabled. |
void
|
sendRequest()
Send the Ajax request. |
void
|
setAsync(<Boolean> asyncBoolean)
|
void
|
setEchoDebugInfo()
Enable client-side debugging. |
void
|
setErrorHandler(func)
|
void
|
setParser(newParser)
|
void
|
setPostRequest(func)
Set the post-request function. |
void
|
setPreRequest(func)
Set the pre-request function. |
void
|
setQueryString(qs)
Set the query string that will be sent to the server. |
void
|
setUseGET()
Send the Ajax request using the GET method, where parameters are sent as a query string appended to the URL. |
void
|
setUsePOST()
Send the Ajax request using the POST method. |
Constructor Detail |
AjaxRequest(url)
a
- String repesenting the URL to which the Ajax request will be sent.
Method Detail |
void addFormElements(form)
form
- , A form DOM element, or the id attribute of the form element from which you wish to accumulate the form values.
void addFormElementsById()
void addNamedFormElements()
void addNamedFormElementsByFormID()
void addNameValuePair(<String> name, <String> value)
name
-
value
-
void addPostRequest(func)
A
- function to be called after receiving the Ajax response. The function is passed a reference of this AjaxRequest object.
void addPreRequest(func)
A
- function to be called prior to sending the Ajax request. The function has passed to it this AjaxRequest object.
Object getParser()
Object getPostRequest()
Object getQueryString()
Object getXMLHttpRequestObject()
Object isEchoDebugInfo()
void sendRequest()
void setAsync(<Boolean> asyncBoolean)
asyncBoolean
- , set to true if asynchronous request, false synchronous request.
void setEchoDebugInfo()
void setErrorHandler(func)
Set
- the error handler function that is called if the server's HTTP response code is something other than 200.
void setParser(newParser)
Set
- the parser that's used to parse the server's XML response, Deaults to the standard TaconiteParser class.
void setPostRequest(func)
The
- function to be called after receiving the Ajax response. The function is passed a reference of this AjaxRequest object.
void setPreRequest(func)
The
- function to be called prior to sending the Ajax request. The function has passed to it this AjaxRequest object.
void setQueryString(qs)
qa
- , the new query string value.
void setUseGET()
void setUsePOST()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |