Using Ajax Wisely

Ajax is a set of technologies that is used to rewrite part of a web page without a complete page refresh. Jesse James Garret coined the term to describe a set of technologies currently coming into their own. This happens by using JavaScript to send a request to the server for information and then using DOM based JavaScript to rewrite a portion of the web page with the data that is returned.

Using this method allows for complex form validation while the user is filling out the form in stead of and in addition to validation following submission. This means that a user can enter their ZIP code for their shipping address and see the shipping charges added to the form before they move on or they can see that the username they want is already taken and have some suggestions shown to them as they type.

The idea is that we can add some of the responsiveness of a desktop application to a web page, reducing the latency that makes filling out forms and waiting for responses so tedious on the web. This can lead to more users completing their tasks as well as a greater sense of satisfaction with the experience among users.

Potential Problems with using Ajax

The biggest potential problem with using Ajax is making it degrade gracefully. Some have already recognized the need for this and are trying to call attention to users who browse without support for XMLHttpRequest, JavaScript, CSS, or other modern web technologies. But we have already seen some applications, such as the beautiful Panic Goods site, that do stunning things in modern browsers but break completely for those without JavaScript support.

Web sites that use Ajax should function when the Ajax technologies are not available to the user. So if their old browser does not support the XMLHttpRequest or DOM based JavaScript that rewrites part of the page, the user can still submit a form normally and see the changes made on the resulting page, albeit a little slower than if they used a better browser.

Progressive Enhancement

From our ideal of failing gracefully we move to the concept of progressive enhancement. Progressive enhancement with Ajax means designing a web site or application that functions without Ajax and then making it easier to use for users with shiny new browsers that support the required technologies.

Following the model of progressive enhancement when adding the new functionality to the web site will continue to uphold the ideal of access to information and functionality for all visitors. This will result in an accessible web site that functions well for everyone regardless of their abilities or their browsers abilities. It’s not about holding back progress as it is making sure nobody is left behind as we go forward.

Kevin Hall

I am one of the owners of Infinite Web Design. I'll be glad to talk with you about who we are, what we do, or any of the topics we write about here.
Kevin Hall