Find Chicago Condos For Sale at this new directory site.
Chicago real estate news

Class AjaxRequest

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

aborted

boolean aborted
    An internal flag to indicate whether the request has been aborted

async

boolean async
    Whether or not the request will be asynchronous. In general, synchronous requests should not be used so this should rarely be changed from true

generateUniqueUrl

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.

groupName

string groupName
    The name of the group that this request belongs to, for activity monitoring purposes

method

string method
    The method of the request, either GET (default), POST, or HEAD

onComplete

functionReference onComplete
    A function reference assigned will be called when readyState=4

onError

functionReference onError
    A function reference assigned will be called after onComplete, if the statusCode != 200

onGroupBegin

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

onGroupEnd

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

onInteractive

functionReference onInteractive
    A function reference assigned will be called when readyState=3

onLoaded

functionReference onLoaded
    A function reference assigned will be called when readyState=2

onLoading

functionReference onLoading
    A function reference assigned will be called when readyState=1

onSuccess

functionReference onSuccess
    A function reference assigned will be called after onComplete, if the statusCode=200

onTimeout

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

parameters

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

password

string password
    The password used to access the URL

queryString

string queryString
    The query string to be added to the end of a GET request, in proper URIEncoded format

requestIndex

<private> int requestIndex
    The sequential index number of this request, updated internally

responseReceived

<private> boolean responseReceived
    Indicates whether a response has been received yet from the server

responseText

string responseText
    After a response has been received, this will hold the text contents of the response - even in case of error

responseXML

xmlNode responseXML
    After a response has been received, this will hold the XML content

status

int status
    After a response has been received, this will hold the status code of the response as returned by the server.

statusText

string statusText
    After a response has been received, this will hold the text description of the response code

timeout

int timeout
    Timeout period (in ms) until an async request will be aborted, and the onTimeout function will be called

url

string url
    The url that the request will be made to, which defaults to the current url of the window

username

string username
    The username used to access the URL

xmlHttpRequest

<private> XMLHttpRequest xmlHttpRequest
    The XMLHttpRequest object used internally

numActiveAjaxGroupRequests

<static> Object numActiveAjaxGroupRequests
    An object holding the number of active requests for each group

numActiveAjaxRequests

<static> int numActiveAjaxRequests
    The number of total AjaxRequest objects currently active and running

numAjaxRequests

<static> int numAjaxRequests
    The total number of AjaxRequest objects instantiated

Constructor Detail

AjaxRequest

AjaxRequest()
    The AjaxRequest class is a wrapper for the XMLHttpRequest objects which are available in most modern browsers. It simplifies the interfaces for making Ajax requests, adds commonly-used convenience methods, and makes the process of handling state changes more intuitive. An object may be instantiated and used, or the Class methods may be used which internally create an AjaxRequest object.

Method Detail

getAllResponseHeaders

Object getAllResponseHeaders()
    Returns the results of XMLHttpRequest.getAllResponseHeaders(). Only available after a response has been returned

getResponseHeader

string getResponseHeader(<string> headerName)
    Returns the the value of a response header as returned by XMLHttpRequest,getResponseHeader(). Only available after a response has been returned
    Parameters:
      headerName - The name of the header whose value you want to retrieve
    Returns:
      Header value

handleArguments

 <private> void handleArguments(<Object> args)
    An internal function to handle an Object argument, which may contain either AjaxRequest field values or parameter name/values
    Parameters:
      args - The Object to handle

process

void process()
    The process method is called to actually make the request. It builds the querystring for GET requests (the content for POST requests), sets the appropriate headers if necessary, and calls the XMLHttpRequest.send() method

doRequest

<static>  <private> void doRequest(method,args)
    The internal method used by the .get() and .post() methods

get

<static> void get(<Object> args)
    Make a GET request. Pass an object containing parameters and arguments as the second argument. These areguments may be either AjaxRequest properties to set on the request object or name/values to set in the request querystring.
    Parameters:
      args - Arguments

getXmlHttpRequest

<static> Object getXmlHttpRequest()
    Returns an XMLHttpRequest object, either as a core object or an ActiveX implementation. If an object cannot be instantiated, it will return null;
    Returns:
      An XMLHttpRequest object

isActive

<static> boolean isActive()
    See if any request is active in the background
    Returns:
      true if there is at least one request currently active, else false

post

<static> void post(<Object> args)
    Make a POST request. Pass an object containing parameters and arguments as the second argument. These areguments may be either AjaxRequest properties to set on the request object or name/values to set in the request querystring.
    Parameters:
      args - Arguments

serializeForm

<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. The 'file' input type is not supported, as its content is not available to javascript. This method is used internally by the submit class method.
    Parameters:
      theform - A reference to the form on the page to serialize, ex: document.forms[0]
    Returns:
      A sequence of URIEncoded name/value pairs

submit

<static> boolean submit(<FormReference> theform, <Object> args)
    Submit a form. The requested URL will be the form's ACTION, and the request method will be the form's METHOD. Returns true if the submittal was handled successfully, else false so it can easily be used with an onSubmit event for a form, and fallback to submitting the form normally.
    Parameters:
      theform - A reference to the form on the page to submit, ex: document.forms[0]
      args - Arguments
    Returns:
      True if the submit succeeded, else false

Documentation generated by JSDoc