Provides basic Asynchronous XML (AJAX) routines. (also see soap.js for simplified SOAP routines.)
THIS IS THE NEW API VERSION. YOU CAN STILL USE THE OLD ONE ( ajax.js ), BUT IT IS OBSOLETE AND UNSUPPORTED. YOU SHOULD SWITCH TO THIS INTERFACE ASAP.
Sends an HTTP request to a pageurl. Valid METHOD names are:
Cancels all pending requests.
Function to be executed when a request is being sent.
Function to be executed when all requests are satisfied (or canceled).
When auth option of request is set to this constant, no authentication will be performed.
When auth option of request is set to this constant, request header with authentication data will be appended using auth basic scheme (as described in rfc2617 ).
Auth digest scheme is not yet supported.
When type option of request is set to this value, request will be returned as plain text.
When type option of request is set to this value, request will be returned as XML document.
When AJAX request is sent, OAT emits this message containing URL of the request and appropriate message code.
When AJAX request is unsuccessful, OAT emits this message containing request object and appropriate message code.
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);