Mistakes About Ajax Mistakes

It was bound to happen. First, after years of seeing webapps with clever JavaScript, iframes etc to do partial page reloads, someone gave the concept a cool name, and lo, Ajax did become the darling of the blogging community.

Ajax (or to use its full name, Asynchronous JavaScript and XML) does improve the user experience for web applications, without a doubt. But it was inevitable that with such a popular "new" concept, people would find ways to criticise it (a good thing) or misunderstand its core purpose (a bad thing) and criticise it for its shortcomings in an area that it was never really intended for.

Alex Bosworth posted a list of "typical" mistakes Ajax developers make, and invited readers to add their own Ajax mistakes onto an ever-growing list.

Many of these are good and valid traps that both "vanilla" web programmers and "pistachio" Ajax programmers should be aware of. But a lot of them also sadly miss the point of Ajax, which we’ll come to in just a moment.

Here’s a spoof of Jacob Nielsen’s 1996 article "Why Frames Suck". The spoof article for the most part substitutes the word "frames" with "Ajax", and makes the point that pretty much all of Nielsen’s points hold true for Ajax. Their main point is that the "social filtering" power of URLs breaks down with Ajax (as it did with frames back in 1996), because when you bookmark a page or email the link to someone, the URL you send won’t load up the same page state that you’re currently looking at.

Another point made in the spoof article is that search engines have trouble with Ajax (as they did with frames back in... etc etc), because they don’t know what page states to include as navigation units in their index.

The spoof is all very clever n’all, but what the spoofer has missed is that Ajax is purposed for web applications, not for web pages. Of course it’s a spoof so it’s beyond criticism(!), but many of the "Ajax mistakes" posted to Alex Bosworth’s blog also appear to miss the same essential point.

We're all agreed that you shouldn't criticize an elephant for falling off a tightrope; and Ajax shouldn't be criticized (much) for being unsuitable for websites.

Try reading through the spoof article linked above, and Bosworth’s Ajax Mistakes page, whilst telling yourself repeatedly: “Ajax is for web applications, not web pages!” It’s surprising how many of the points suddenly lose their pointiness.

About the Author

Matt Stephens is a senior architect, programmer and project leader based in Central London. He co-wrote Agile Development with ICONIX Process, Extreme Programming Refactored, and Use Case Driven Object Modeling with UML - Theory and Practice.