Thursday, 01 June 2006 Print E-mail RSS Feeds Bookmark

Ajax has Landed: The New Alternative for the Modern Dynamic Web

An all new concept that has taken the internet by storm and, together with Web2.0, it is here to change our internet experience forever. Ajax (Asynchronous Javascript and XML) is not a technology, it is a term coined in February 2005 by Jesse James Gareth to describe a set of technologies that constitute some of the key elements of Web 2.0. But is this new?
 
Ajax, as a term, has been in existence for just over a year. However, the set of technologies that constitute Ajax are actually mature technologies that have existed for some time. Javascript, one of the most influential scripting languages on the web, made its appearance in the mid 90's and is used to make websites more interesting and dynamic. As a language, it can function both as object- oriented and as procedural language. And the eXtensible Markup Language (XML) is a general-purpose markup language capable of describing many different kinds of data in a structured manner.
 
In the 'Ajax' approach, the difference comes with the 'asynchronous' part and the XMLHttpRequest Application Programming Interface (API), where a web page does not need to be reloaded when minor changes are made to it. In essence, Ajax is a way of adding responsiveness on to a website, a characteristic that is mainly seen on desktop applications or Java Applets.
 
Page reloads is the great annoyance of the web. No matter how fast is your internet access – even now that over 80% of UK's population, for example, is using broadband according to www.i-level.com – you will still have to wait for the whole page to reload just so that you can see if you have received a new email, or maybe because you decided to move a satellite map that you were browsing.
 
Image
The traditional model for web applications (left) compared to the Ajax model (right). (Image courtesy of Adaptive Path LLC.)
 
 
With Ajax, on the other hand, if we take for example the famous Google Maps (maps.google.com), we can zoom in/out and move the map around live. In other words, only the map is moving, without the page being reloaded. In this case, only the specific section of that page gets reloaded. And, indeed, this is how it should be for an ultimate, quick, web experience.
 
Image
Google Maps. An example of Ajax in action. (Image Courtesy of Google)
 
 
Although XML has been used extensively throughout the years, XMLHttpRequest has not. XMLHttpRequest is an API that with the use of a web scripting language, such as Javascript, it can transfer and manipulate XML data to and from a web server using http. It was originally developed by Microsoft and as early as Internet Explorer 5. Microsoft called it XMLHTTP and it was available through the ActiveX object.
 
XMLHttpRequest is a major part of Ajax and it is this that gives it the extra responsiveness and makes Ajax dynamic and places it under the Rich Internet Applications list.
  
Rich Internet Applications like Macromedia Flash (now owned by Adobe) and Java Applets, have existed for over 5 years and are widely used for providing some of the best features and functionality of a traditional desktop application. But you still need to have the required plugins, which come as standard with most newer web browsers. Conversely, Ajax does not need a plugin. What it does require, though, is for Javascript to be enabled in the user's web browser. Also, if the user is using Microsoft Internet Explorer 6 or below, ActiveX needs to be enabled in addition to Javascript. Although it is only one year old, there are already many libraries and frameworks in existence that can boost your productivity when developing an ajax-enabled website, or web-based tool. Both php and Java languages are compatible and it is up to the individual developers to decide what is the best one to use according to their specific requirements.
 
However, with great power comes great responsibility (Stan Lee – Spiderman).
 
There are a number of issues that need to be addressed by developers when dealing with Ajax. First and foremost, due to it being asynchronous in nature, a great concern emerges that is directly related to network latency – the interval between user request and server response – which needs to be clearly shown to the user. Otherwise, without a page reload and nothing happening for some time, it may be a good enough reason for your visitors or online users to leave your website and move on to a different one.
 
Secondly, there is the issue of caching (storage of downloaded Web files for later re-use). Each time some interaction takes place between the user and the web page, and data being sent backwards and forwards, that information is being cached and as a result, if the user should click on the back button he/ she would get some very unexpected results. For example, the user might expect to go to the previous state, just like clicking on the undo button on a desktop application, but instead will end up with the originally loaded content. This can be seriously confusing for the users. For a longer list of such issues, you can visit: http://sourcelabs.com/ajb/ achives/2005/05/ajax_mistakes. html , as well as Wikipedia's article on Ajax at: http://en.wikipedia.org/ wiki/AJAX.
 
The Ajax-trend welcomes users to Web2.0 and Internet's evolution. Seen by many as a development methodology for providing interactive and desktop-like applications, Ajax is here to reveal a more enjoyable web experience. Taking its place between the two main players on the internet, namely Flash and Applets, it looks like Ajax is here to stay.