Ajax: It's not only code

Ajax works outside the page but safely inside the JavaScript sandbox.

This article is excerpted from Learning JavaScript, by Shelley Powers, with the permission of O'Reilly Media. All rights reserved.

Ajax provides a huge bang for the buck, especially when you really need the functionality. The first time your web-page form is validated in place, you’ll see what I mean. When you can click on a button and collapse a huge form, clearing up the clutter on the page, you’ll be convinced Ajax is the One True Way.

Well, yes and no. Ajax, like other JavaScript-enabled applications, has its pluses and minuses.


If you wanted to, you could create an entire web site in one page, using Ajax and other JavaScript-enabled and replace functionality based on your web-page reader’s actions. However, the problem with this is that it becomes increasingly difficult to recreate a specific view of the content.

Ajax, like all DHTML functionality, does not create permanent page effects. They have to be recreated each time a page is loaded, or each time a person makes a sequence of movements. They may not be accessible via source or printable.

There will be no permalink to individual pieces, nor will your web-page readers have a history of their actions.

Most of all, when your web-page reader hits the Back key, rather than being taken in a reverse direction within the Ajax/DHTML display stack, chances are she will be taken completely out of the page.

There are entire frameworks that have taken on these issues, with solutions such as resolving an anchor-tag release into a sequence of Ajax calls and/or DHTML. However, for the most part, before you look into these, you should ask whether having this capability is essential to your work. Again, if Ajax and DHTML are complementary approaches available to help other more traditional work, then chances are you have what you need with existing technology; you won’t have to add what could be large libraries. For instance, if Ajax and DHTML are used to dynamically validate a form as it’s being completed, a bookmark to the form page should be sufficient.


One of the first and most common uses of JavaScript was to build menus. This is both sad and funny because one aspect of your site that should be completely accessible—no matter by whom or by what browser—is site navigation. JavaScript navigation breaks most accessibility tools.

One of the best pages on Ajax and accessibility is the WebAIM (Web Accessibility in Mind) page on the topic. In addition to covering the issues, it also links to other sites that provide additional information.
1 2 3 4 5 6 Page 1
Page 1 of 6
7 inconvenient truths about the hybrid work trend
Shop Tech Products at Amazon