ajax.js

Provides basic asynchronous xml call (Ajax) routines.


Functions

Constants


OAT.Ajax.command(method, target, data_func, return_func, return_type, customHeaders)

Sends an HTTP request to a page target. Use predefined constants to specify request type (in argument method):

HTTP headers may be specified as properties of customHeaders argument.

Argument data_func specifies a callback to function which returns data to be sent. When response arrives, return_func(data) will be called. Example:

OAT.Ajax.user = "username";
OAT.Ajax.password = "top_secret";
var callback = function(data) { alert(data); };
OAT.Ajax.command(OAT.Ajax.GET + OAT.Ajax.AUTH_BASIC, "http://www.securesite.com/", function(){}, callback, OAT.Ajax.TYPE_TEXT);

OAT.Ajax.setStart(callback)

Specifies a function to be called when the asynchronous request is being called (i.e. some user alert etc.).

OAT.Ajax.setEnd(callback)

Specifies a function to be called when the last response is recieved.

OAT.Ajax.setCancel(element)

Marks element as an interruptor - when user clicks it, all Ajax calls are interrupted. Only one element can be marked this way.