AJAX - web applications the easy way

IT Pro Guide: It's not a cleaning product, or a hero from classical civilisation... so what is it? Marcus Austin delves into the detail behind AJAX, one of the Web's latest buzzwords

You will all by now have used web applications such as Google's Gmail email service or their Toolbar service. If not then perhaps you should, because you'll be amazed by just how quickly they work.

If you compare Gmail to another webmail-based system the first thing you'll notice is the screen refresh time. With webmail you're constantly waiting for a new page to be drawn from scratch as you move between emails. Gmail, however, seems to refresh the screen in an instant. The secret behind this and other similar web applications is a combination of software applications and services that are collectively known as Asynchronous JavaScript And XML, or more commonly by the acronym AJAX, and they're revolutionising the way websites interact with users.

The main reason why Ajax applications are so fast at what they do is because they're client-side applications that run on users' PCs. Redraws and any graphical manipulation are all taken care of by the client's processor rather than the web servers at the other end, which increases the speed of response, reduces the server's processor overhead and increases the interactivity between websites and users.

It's a great choice for Web-based chat programs, where many users can chat together at the same time, grabbing lists of data, as in Google's Suggest beta (http://www.google.com/webhp?complete=1), for enabling interactivity in pop-ups, dragging and dropping, or modifying web pages on the fly.

How does it do that?

AJAX works by exchanging small amounts of data with the server behind the scenes, so that the entire Web pages do not have to be reloaded each time the user makes a change. To the user it looks and feels much more like using a desktop application than a traditional web application.

In fact it's not just one technology achieving this effect it's actually made up of several components. AJAX uses HTML and Cascading Style Sheets (CSS) for the application's look and feel, the data is stored and fetched in XML format, the data fetches use the XMLHttpRequest object, and it uses JavaScript as the glue between all of the different layers.


As with DHTML applications, AJAX applications have to be tested rigorously to deal with the quirks of different browsers and platforms. A number of programming libraries have become available as AJAX has matured that can help ease this task. Likewise, techniques have been developed to assist in designing applications which degrade gracefully and offer alternative functionality for users without JavaScript enabled.

While no browser plug-in is required for AJAX, users need to have JavaScript enabled in their browsers. This applies to all browsers that support AJAX except for Microsoft Internet Explorer 6 and below which also need ActiveX to be enabled. However Microsoft has announced that Internet Explorer 7 should be able to implement AJAX applications without ActiveX.

Another common complaint about AJAX applications is that they can break back button functionality in browsers. Google Maps demonstrates, however, that with careful coding, such browser functionality need not be compromised.


Because AJAX requires so many features to be enabled before it will work and it's limited to just a few browsers, anyone working on AJAX web applications should look at providing fallback options for those on other platforms or browsers - visually impaired users, for instance. It's also essential that you don't rely on it as the only way you interact with your users.

Be aware, however, that some fallback options can put extra strain on your server and can be time consuming to build, so developers need to make the decision early on as to how important those non-AJAX users are. Google has made the decision for Gmail not to fall back, for instance, and it gets around this by keeping the service in a constant state of beta, playing a waiting game with users' browser capabilities.

Featured Resources

Virtual desktops and apps for dummies

An easy guide to virtual desktop infrastructure, end-user computing, and more

Download now

The total economic impact of optimising and managing your hybrid multi-cloud

Cost savings and business benefits of accelerating the cloud journey

Download now

A buyer’s guide for cloud-based phone solutions

Finding the right phone system for your modern business

Download now

What’s next for the education sector?

A new learning experience

Download now

Most Popular

KPMG offers staff 'four-day fortnight' in hybrid work plans
flexible working

KPMG offers staff 'four-day fortnight' in hybrid work plans

6 May 2021
Hackers use open source Microsoft dev platform to deliver trojans

Hackers use open source Microsoft dev platform to deliver trojans

14 May 2021
How to move Windows 10 from your old hard drive to SSD
operating systems

How to move Windows 10 from your old hard drive to SSD

30 Apr 2021