AjaxRequestProvider.RegisterRequest(url, callback, callbackParam)
This function enqueues your request and will execute as soon as possible.
If answer is okay (200 OK) callback will be called with answer.
function callback(responseText, callbackParam){ alert("Return "+callbackParam+" okay:"+responseText); } AjaxRequestProvider.RegisterRequest('/json.do?_SYSTIME', callback, 1 ); AjaxRequestProvider.RegisterRequest('/json.do?_SYSTIME', callback, 2 );
AjaxRequestProvider.RegisterRequestXML(url, callback, callbackParam)
Behave similar to RegisterRequest except the first parameter in callback will be the XML-DOM.
Example:
function callback(responseXML, callbackParam){ var n = responseXML.getElementsByTagName("tag").length; alert("XML returned. Number of \"tag\"-tags"+n); } AjaxRequestProvider.RegisterRequestXML('/data.xml',callback);
AjaxRequestProvider.RegisterPostRequest(url, content, callback, callbackParam)
This function can be used to save files on the device.
function saveuploadcallback(){ alert("File saved"); } AjaxRequestProvider.RegisterPostRequest( "/html/test.html", // Filename on device "file content test", // Content saveuploadcallback, // Callback null );