11.4. When Not to Use AJAX

The explosive interest in AJAX is somewhat of a double-edged sword. There was a similar boom in the use of Macromedia's Flash product. Clients were asking for it because it looked cool. Just as with Flash, AJAX introduces usability and accessibility concerns, many of which are solved problems in traditional web applications.

For example, AJAX applications exist in one URI namespace. In other words, the URI doesn't change when the user interacts with the application. This makes sense, as that's one of the main selling points of AJAX: the ability to change application state without refreshing the current page or moving to a different page. However, this renders the browser's back button useless and might even cause the user to navigate from your application altogether.

In 1999 Jakob Nielsen, a well-known usability expert, issued an article indicating the top ten mistakes of web design. The number one mistake was disrupting the functionality of the browser's back button. According to Nielsen, the back button is the "second-most used navigation feature" after the use of hyperlinks. Workarounds do exist to partially replicate back-button functionality.

Another related usability problem has to do with the inability to bookmark a specific application state. In traditional applications, an application state is often unique to a single URI and can therefore be bookmarked. An example of this is when a user navigates a product catalog to a detail page of a specific ...

Get Professional LAMP: Linux®, Apache, MySQL®, and PHP5 Web Development now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.