Friday, February 17, 2006

What is Ajax? Past, Present and Future.

The world is changing. This opening line from the Lord of the Rings is powerful; these words resonate in my mind every time I think about what is happening in the World Wide Web today.
Things are boiling hard and the lessons learnt from the failure of .COM era are producing new needs and new ideas. New concepts are being created every day and becoming part of a new landscape that is still unshaped and changing daily.
A new term has been forged to describe in one word a set of technologies and concepts that developers are putting together to create the new and remodeled Web 2.0 scenario. This term is Ajax. It means “Asynchronous JavaScript and XML”.

Is this a new technology? Not really. It is mostly a new way of reusing “old” technology.

To explain this concept I’ll briefly describe the various parts of the definition of Ajax, how they came to existence and why they are now melted together.


JavaScript, originally called LiveWire and LiveScript, has been around since Netscape 2 which was released in early 1996. The most important additions to this version of the browser were frames and JavaScript.
This new language looked somewhat similar to Java and was very useful to create interactive web pages with embedded logic. The example of Netscape was followed by Microsoft that spewed out variations under the name of Jscript and Active Scripting.

The usual scenario that annoyingly repeats itself in history over and over. Somebody comes up with a good idea. Somebody else likes it and makes its own version, without substantial improvements, confusing the world and generating strands of similar but not completely compatible technologies.


It all started at IBM in 1969, with the Generalized Markup Language (GML). This was invented by Charles Goldfarb, Ed Losher and Ray Lorie during a research project on integrated law office information systems. It was used as a means of allowing text editing, formatting and document sharing.
Goldfarb carried on the work on GML and in 1974 invented the Standard Generalized Markup Language (SGML). In 1986 this was adopted as one of the ISO standards.

In 1989 Tim Berners-Lee invents HTML (Hypertext Markup Language) while working at computer services at CERN (European Laboratory for Particle Physics in Geneva, Switzerland). The first web browser to support HTML was a prototype written by Tim on a NeXT computer.

The World Wide Web Consortium (W3C) combined the power of SGML with the simplicity of HTML and came up with XML, which is a small subset of SGML.

HTML grew into various incarnations, and the latest ones include XHTML and CSS, which allow for a more powerful and generalized description of web pages.


Now, what about the word “Asynchronous” in the definition of Ajax?

This describes the addition of XMLHttpRequest Object to the tools available to the JavaScript developer. This Object allows asynchronous retrieval and manipulation of XML data. It was introduced as an ActiveX object by Microsoft and today is available as a native object within both Mozilla and Apple’s Safari browsers.

In other words, the XMLHttpRequest object ties up JavaScript and XML into something powerful and somewhat innovative.

JavaScript and XML combined with the XMLHttpRequest object provide the foundation for client side computation and presentation of data. Their use is acquiring new forms and is becoming the technology trend of today’s web.

The World is Changing

Unfortunately the phrase “The World is Changing” describes well the situation of the Web today, but it doesn’t describe something crystallized and stable; in fact, it is not. It is changing, rapidly, in a way that resembles Darwinian species evolution. Some strand of changes survives. Others die. Only the best moves forward.

This process takes time and hopefully will lead to good results in the end.

The Hope

It would be great if there was a single technology standard (not maker!) that is guaranteed to work well on all platforms, browsers and servers. It would be great if developers and users didn’t have to know about JavaScript security settings, various browser versions and all sort of incompatibilities across platforms.

It is very hard today for a developer to write a piece of JavaScript that is guaranteed to work well on all browsers, or at least the most important ones.

Take the XMLHttpRequest object for example. It is an ActiveX object in IE, but it is a native object in Safari and Mozilla. This means that you instantiate it in different ways depending on the browser, and the JavaScript code needs to find out which way to use and do the right thing accordingly. This is just one of the examples, but there are many others. Often the differences between browsers and standards are small, but big enough to increase the complexity of development and the frustration of users.

There is the need for something truly standard that solves all these problems, or for a consortium to standardize what’s happening. In reality the game seems to be in the hands of some major players that may or may not decide to adhere to whatever standard is proposed. Perhaps, and hopefully, this will change too and major players will be forced to do what is good for the users and not what is good for themselfs.

The Web needs to be an easier place for creativity to develop great content; it does not need to be a fighting arena for supremacy and should not force engineers to spend all their energies to create sophisticated ways to work around artificial and complex compatibility issues across technology makers.

No comments: