ajax2.js

Provides basic asynchronous xml call (AJAX) routines.

THIS IS THE NEW VERSION OF API. YOU CAN STIL USE THE OLD ONE (ajax.js), BUT IT IS OBSOLETE AND UNSUPPORTED. YOU SHOULD SWITCH TO THIS INTERFACE ASAP.

Functions

Valid method names

Properties

Constants

Messages


OAT.AJAX.[METHOD](url, data, callback, options)

Sends an HTTP request to a page url. Data to be contained in request are specified in data. When response arrives, callback(response) will be executed. You may specify the following options:

To prevent JavaScript hijacking attacks, web application authors are encouraged to use some of the countermeasures described in 'security' part of the documentation.

var options = {
	user:"username",
	password:"top_secret",
	auth:OAT.AJAX.AUTH_BASIC,
	onerror:function(request) { alert(request.getStatus()); }
}
var callback = function(data) { alert(data); };
OAT.AJAX.GET("/myfile.xml", false, callback, options);

OAT.AJAX.abortAll()

Cancels all pending requests.

OAT.AJAX.startRef

Here you can give a function to be executed when a request is being sent.

OAT.AJAX.endRef

Here you can give a function to be executed when all requests were satisfied (or cancelled).