WEBSITE DESIGN

Building Applications with AJAX

Programming using Asynchronous JavaScript and XML is behind some of the most popular applications online -- and it can help make your site stand out too.
Advertisement

Running a business on the World Wide Web can be a source of frustration if you don't have the right tools. Many business owners continue to expect their customers to wait what seems like an eternity for an entire webpage to load if a customer changes what they want to see or buy. But a wait of even a few seconds can be more than a frustration to a customer. It can convince them to shop somewhere else.

To avoid such lost sales, businesses that sell goods online need to become familiar with AJAX, a development tool that can be used to create interactive Web applications without requiring a new page to load.

What Is AJAX

AJAX stands for Asynchronous JavaScript and XML. In layman's terms it works like this: Say a custom shoe company wants to make it easier for customers to create their perfect pair. On an AJAX-designed site, each time a customer clicks on a new color, it simply pulls up a new image or object, instead of loading an entirely new page.

How does it work? Asynchronous applications are, basically, those that can do more than one thing at a time. We’ve come to expect this from most programs. For example, you don’t expect your screen to go blank whenever you hit the save button in Microsoft Word, but in Web-based applications it’s always been a case of having to wait for an entirely new page every time you perform any operation, regardless of how small. AJAX performs this function by using a bunch of already popular technologies such as XML, HTML, JavaScript, and the XMLHttpRequest object to make quick updates to the user interface without having to reload the entire webpage on a browser.

AJAX Behind the Scenes

With AJAX, JavaScript code embedded within webpages runs when a user performs an action. That JavaScript makes a request from a host typically running some sort of application server. The host returns an XML-formatted message containing some information. That information is then processed by more JavaScript code to dynamically update the page being displayed, showing the retrieved information.

The important point here is that only the information that has changed is sent back from the server, not the entire page. Think of a photo browsing page that displays 20 high-resolution pictures at a time. The page gives the user the ability to select and zoom in or out on any of those pictures. Even with browser-based caching it would be inefficient to refresh the entire page and all its pictures whenever the user selected one to take a closer look. With AJAX the page can request that single image in whatever size is required then display it without reloading the page.

Benefits for Your Business

The obvious benefit for your business of using AJAX on your website is performance. Webpages are much more responsive when they don't need to be completely reloaded after every click. Responsive webpages are more effective and will make customers stay longer and, hopefully, buy.

On the server side, AJAX has huge benefits for websites that have sporadic traffic patterns. MacRumors.com, a website that sees a huge influx of traffic when Apple Computer is making product announcements at Macworld, uses AJAX to limit its bandwidth usage. “The setup was designed to offer unlimited scalability and tailored to provide live text updates to a large audience of people,” the website says. The website goes on to say that it uses AJAX to reduce the amount of data that needs to be sent to individual viewers. “If not for the efficiency of the MacRumorsLive AJAX update system, the same webcast would have required approximately twice as many servers and would have had to transfer almost 6 times as much data,” the website says.

Other AJAX proponents define the business benefits in terms of time savings. Ajax Info, a website that compares traditional Web applications with those created with AJAX, concludes that “a business can save between 500 and 2,800 man hours per year on a 10-step hypothetical process, saving roughly four seconds per step (a between 30 percent and 70 percent reduction in labor costs).”

Challenges Remain

At the same time, business owners need to be aware that while as many as 93 percent of Web browsers used by the general population are AJAX-compatible, there are other users who will be excluded from accessing these applications, according to a May report from Forrester Research. Those excluded users include the following:

  • Those who use screen readers. Web users who rely on screen readers – a software application that helps blind users or people with vision problems -- may be disadvantaged by Ajax because screen readers rely on being alerted that a page has been updated or changed and AJAX applications may not trigger those screen readers that a change has been made, according to Forrester. While the number of computer users reliant on screen readers is small, there are laws on the books in the U.S. requiring reasonable accommodations for people with disabilities.
  • Those who use mobile devices. While the Web browsers on cellular phones with Internet connectivity are becoming more sophisticated, many still don't support AJAX.
  • Those who use employers’ computers.  Some companies disable JavaScript on sites outside the intranet in response to security fears or other concerns and that means employees will not be able to take advantage of the AJAX-enhanced site, Forrester says.
Last updated: Oct 1, 2006




Register on Inc.com today to get full access to:
All articles  |  Magazine archives | Livestream events | Comments
EMAIL
PASSWORD
EMAIL
FIRST NAME
LAST NAME
EMAIL
PASSWORD

Or sign up using: