What Is AJAX?
November 12, 2008 Paul Tuohy
Depending on who you talk to AJAX is either “another flash in the pan” or “the greatest thing since sliced bread.” As usual, the truth probably falls somewhere in between.
In this, the first of two articles, I want to discuss what AJAX is and why you might want to use it. In the following article I will give a simple example of using AJAX with an RPG CGIDEV2 program.
AJAX allows programmers to dynamically update an existing Web page as opposed to loading a new page. In other words, AJAX provides a means for the server to update the current Web page as opposed to sending a new page.
Here are some simple examples of where you might use AJAX:
The use of AJAX provides numerous ways of enhancing Web page interaction for a user.
In Web terms, the techniques used with AJAX are “old”; they have been around since the late 90’s. They are a result of a progression of techniques used in Hidden Frames, IFrames, Dynamic HTML (DHTML), and XMLHTTP.
Most of these techniques were pioneered by projects at Google Labs. For example, Google Suggest uses AJAX to provide a list of search suggestions as you type into the search box, and Google Maps uses AJAX to allow you to scroll through a map (parts of the map are retrieved as you scroll) or it uses AJAX to show details of an item on a map as a pop-up.
But where did the term AJAX come from? In February 2005, Jesse James Garrett of Adaptive Path, LLC, published, Ajax: A New Approach to Web Applications, where he coined the term AJAX.
The article led to a wave of AJAX articles, code samples, and debates. Suddenly, everyone was talking about AJAX.
The other main component in the success and rapid adoption of AJAX was the increase of broadband usage. Google Maps would not have succeeded on dial-up alone!
Why Is AJAX So Popular?
The popularity of AJAX cannot be put down to a catchy turn of phrase in an article. Providing a name for the techniques may have provided a focus, but that in itself is not enough to make programmers use it.
There are a few components that have led to the success of AJAX:
According to Garret, AJAX is a technique that combines and exploits some long-standing Web technologies:
In the End
But be assured that AJAX has plenty to offer any i developer who writes programs for the Web. In the next article we will look at AJAX in action.
Paul Tuohy is CEO of ComCon, an iSeries consulting company, and is one of the co-founders of System i Developer, which hosts the RPG & DB2 Summit conferences. He is an award-winning speaker who also speaks regularly at COMMON conferences, and is the author of “Re-engineering RPG Legacy Applications,” “The Programmers Guide to iSeries Navigator,” and the self-study course called “iSeries Navigator for Programmers.” Send your questions or comments for Paul to Ted Holt via the IT Jungle Contact page.