Published on 2005-08-02 10:11:09

You can use the AJAX Framework to call simple page or web services.
Sample usage : function pageCallback(response){ alert(response); } var ajax = new AJAX(); ajax.callPage("mypage.html", pageCallback); Sample usage with Web services : function serviceCallback(response){ alert(response); } var ajax = new AJAX(); ajax.callService("MyWebService.asmx", "MyMethodToCall", serviceCallback);

You can find more examples on the home page, you can also set an error handler function so you can redirect in case of error or display message function myErrorHandler(error){ alert(error); } var ajax = new AJAX(); ajax.onError = myErrorHandler;

The project is a single javascript file, you can download it from sourceforge

Previous Page


Related Entries

Member of the PHP Magazine Network, Copyright (C) 2005-2008 phpmagazine.net All Rights Reserved