Class AjaxRequest

Object
   |
   +--AjaxRequest

class 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

AjaxRequest(url)

Method Detail

addFormElements

void addFormElements(form)

addFormElementsById

void addFormElementsById()

addNamedFormElements

void addNamedFormElements()

addNamedFormElementsByFormID

void addNamedFormElementsByFormID()

addNameValuePair

void addNameValuePair(<String> name, <String> value)

addPostRequest

void addPostRequest(func)

addPreRequest

void addPreRequest(func)

getParser

Object getParser()

getPostRequest

Object getPostRequest()

getQueryString

Object getQueryString()

getXMLHttpRequestObject

Object getXMLHttpRequestObject()

isEchoDebugInfo

Object isEchoDebugInfo()

sendRequest

void sendRequest()

setAsync

void setAsync(<Boolean> asyncBoolean)

setEchoDebugInfo

void setEchoDebugInfo()

setErrorHandler

void setErrorHandler(func)

setParser

void setParser(newParser)

setPostRequest

void setPostRequest(func)

setPreRequest

void setPreRequest(func)

setQueryString

void setQueryString(qs)

setUseGET

void setUseGET()

setUsePOST

void setUsePOST()


Documentation generated by JSDoc on Thu Apr 15 22:04:54 2010