Ajax Frameworks

The best technology to build dynamic web pages is Ajax. JavaScript code embedded into the HTML page is used to send requests to the server. At the server side, some processing is required to handle them, find the info or store the data. To do that, we need for a specialized framework. The framework has always a JavaScript part, and sometimes a server side part in another scripting language. A lot of them exist in various programming languages, in all environments around, but we retain here only the most widely used.

Summary

Why a framework?

Actually, this framework is the Ajax engine described by J. J. Garrett and intended to suppress waiting for the user when accessing the server.
The framework provides classical, cross-browser functions to use the XMLHttpRequest object. But a framework may goes beyond that, and allow to build "rich web applications", applications with a graphical user interface and other features of desktop software that run through a browser, while exchanging data with a remote server.

Features of an Ajax framework

Any Ajax framework is able to communicate with the server, and thus, to read data or to send it data or commands. In the last case a server-side script is required.
The frameworks often add components that make use of the asynchronous communication with the server.
The classical examples are buttons, tabbed panels, grids, listboxs and other such widgets.
A more innovative example, the "boxes", are more and more often implemented, and Lightbox and Slimbox are two of them. There are image galleries that place them side by side on the screen and that are making use of Ajax to display them instantanously .

Framework may be server-driven also, and in this case, component are created on the server with a scripting language such as PHP, and sent to the browser. Ajax is used to transmit user actions to the server part, and to handle the results.

The ability to work offline as it is offered by HTML 5 is a complement to the Ajax framework as well.

What Ajax framework to choose?

You want to use an Ajax framework to make dynamic pages without having to rewrite the whole stuff youself and test it on all browsers...
But they are so numerous that you wonder which one to use. You want not make a bad choise and be forced later to redo all the pages with a different framework!

You are less likely to regret the choice of a framework if you adopt one of the most used because they are continually supplemented by new extensions and have a good support by users.
Among these, there are jQuery, well documented, Mootools that is modular, Ext JS offering many widgets for RIA.
The interaction with a server side language also should guide the choice.

JavaScript libraries

Many Ajax frameworks and libraries rely solely upon JavaScript and contain no server components and therefore server technology dependencies.
Most of them use XML as data format, and sometime JSON, another textual format.
A JavaScript library is loaded with just a tag, as this:

 <script src="prototype.js" type="text/javascript></script>

This tag includes the "prototype" library into the page and its function become usable by the browser, in this page.
Such Ajax libraries and frameworks include:

PHP frameworks

On the server side, the programmer may use PHP functions to process requests from the browser. PHP allows to deal with database, search data, build pages or parts of page and publish the page or return data to the XMLHttpRequest object. PHP 5 specifically, thanks to its SimpleXML class, is able to create XML files that may be returned to the object. But all these tasks require special functions to write... however the work is already done in some free open source frameworks.

Java frameworks

Java is the programming language that is the more often used to build web services.
A Java framework permit to use Java web services interactively with a web page.
The more commonly used are:

Legacy Java software for the web now is moving to Ajax. JavaServer Faces now includes Ajax features. ThinWire takes a unique approach in that the application is written as if it was a desktop software. All the logic executes on the server, the framework encapsulates the web rendering and communication layers.

.NET frameworks

Ajax and XUL

Ajax makes use of the JavaScript programming language, and markup languages embeds also JavaScript into XML to define the interaction with the graphical user interface. The two systems work on the Firefox browser. The first one allows to communicate with the server from a remote web page, the second one displays an interface either in a local computer or through the net, with the same browser.
The main difference is in the use of Canvas (HTML tag) to extend Ajax and to extend XUL, XPCom and XBL.

Beyond Ajax

Some current developments will reinforce again the importance of Ajax by providing standard for RIA (Rich Internet Applications), mainly HTML 5 that extends HTML with Web applications features and that allows a Web application to run offline.

Resources


© 2006-2014 Xul.fr