Overview

The AJAX Framework is a cross browser framework that allows developers to quickly develop web pages that can call web services, web pages and other types of content through JavaScript without having to submit the current page.

The AJAX Framework is:

  • Easy to use.
  • Works well with other existing frameworks.
  • Supports both "GET" and "POST".
  • Works with Internet Explorer 6+, Opera 8+, Safari 3+, Firefox 2+, Google's Chrome and other Mozilla based browsers.
 
Try It

callPage example:

This example uses the callPage method to retrieve the contents of another page and display the contents using an alert call.

 
Examples

callPage example:

function pageCallback(response){
alert(response);
}

var ajax = new GLM.AJAX();
ajax.callPage("mypage.html", pageCallback);

serviceCall example:

function serviceCallback(response){
alert(response);
}

var ajax = new GLM.AJAX();
ajax.callService("MyWebService.asmx", "MyMethodToCall", serviceCallback);

serviceCall with parameters example:

function serviceCallback(response){
alert(response);
}

var ajax = new GLM.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 GLM.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 GLM.AJAX();
ajax.onError = myErrorHandler;
 
Documentation

Up to date full API documentation is available at http://www.godlikemouse.com/glm-ajax
 
Download

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

The AJAX Framework was developed by Jason Graves (GodLikeMouse) http://www.godlikemouse.com and is free to use under the GNU General Public License (GPL). See the README file for more details.
 

SourceForge.net Logo Support This Project