Ajax Framework

Overview
The AJAX Framework is a cross browser framework that allows developers to quickly develop web pages that can call web services and server pages through javascript without having to submit the current page.
Examples
callPage example:

function pageCallback(response){

alert(response);

}

var ajax = new AJAX();
ajax.callPage(“mypage.html”, pageCallback);

serviceCall example:

function serviceCallback(response){

alert(response);

}

var ajax = new AJAX();
ajax.callService(“MyWebService.asmx”, “MyMethodToCall”, serviceCallback);

serviceCall with parameters example:

function serviceCallback(response){

alert(response);

}

var ajax = new AJAX();
/* paramters are added to the end of the callService method in key=value pairs. */
ajax.callService(“MyWebService.asmx”, “MyMethodToCall”, serviceCallback, “myParameter1=hello”, “myParameter2=world”);

serviceCall with custom namespace example:

function serviceCallback(response){

alert(response);

}

var ajax = new AJAX();
/* set new namespace for use with web service. */
ajax.setNameSpace(“http://mynamespaceuri/”);
ajax.callService(“MyWebService.asmx”, “MyMethodToCall”, serviceCallback, “myParameter1=hello”, “myParameter2=world”);

error handling example:

/* by default the errors are alerted. To suppress this you must redirect them. */
function myErrorHandler(error){

alert(error);

}

var ajax = new AJAX();
ajax.onError = myErrorHandler;

Download
Download the latest version at http://sourceforge.net/projects/glm-ajax/
 

1 Response to “Ajax Framework”


  1. 1 dbametrix November 8, 2009 at 4:30 pm

    Hi,

    Thanks for sharing.

    Regards,
    Gitesh
    http://www.dbametrix.com


Leave a comment




August 2006
M T W T F S S
 123456
78910111213
14151617181920
21222324252627
28293031  

Blog Stats

  • 6,818 hits