Bunoon: TESS | Manual | AJAX

This area is used for handling and creating AJAX objects, which are used to communicate with a server. With AJAX, your web application can use this area to send data, and receive data from, a server. This is done in the background and does not interfere with the performance, behavior or display of your web application (unless you have specifically stated for display changed to happen in the response).

Extra options have been made available to make AJAX commands as easy as possible (for example, you can sent a URL, or build up a URL using an existing Form).

Sets up a XML HTTP object and sends a request based on the settings passed and handles the results as specified.

The main arguments for this function are as follows:

  • oProperties [Object] - The properties that should be applied to the new AJAX object.
  • oProperties - Options:
    • "Get" [Boolean] - States if we should be using a GET or POST command (defaults to true for GET).
    • "URL" [String] - States the URL that should be sent (defaults to null).
    • "Form" [Form] - Allows a Form to be used instead of "URL" (defaults to null).
    • "Async" [Boolean] - States if we should be using a asynchronous connection or not (defaults to false).
    • "XML" [Boolean] - States if we should be using a Test of XML response (defaults to false for Text).
    • "Encode" [Boolean] - States if the arguments in the "URL" or "Form" should be encoded.
    • "OnSuccess" [Function] - States the function to call upon receiving a valid response (takes the result data as an argument, defaults to null).
    • "OnError" [Function] - States the function to call when an error has occurred (defaults to null).

The return value for this function is as follows:

  • [Boolean] - A boolean of true/false to state of we have completed the operation.

Below is an example of how to use this function:

function SendRequest () {

var OnSuccess = function (sResponse) {

alert("Success");

};


var OnError = function () {

alert("Error");

};


var bReturnVal = $T.AJAX.Send({

"Form": document.TestForm,

"OnSuccess": OnSuccess,

"OnError": OnError

});


return bReturnVal;

}

Creates a new XML HTTP object (based on the browser).

The return value for this function is as follows:

  • [Object] - The XML HTTP object (or null if any error has occurred).

Below is an example of how to use this function:

var oNewXML = $T.AJAX.New();