Datasheet

Invisible Data Retrieval
The longer you look at a web page, the greater its chance to go out of date. With an Ajax application,
even though on the surface the web page might not be told to do anything, it could be updating itself
behind the scenes.
Constant Updating
Because you’re not waiting for a page refresh every time, and because Ajax can retrieve data under the
covers, the web application can be constantly updated. A traditional software application such as Word
or Outlook will alter the menus it displays or the views it shows, dependent on its configuration, or the
data it holds or the situation or circumstances it finds itself in. It doesn’t have to wait for a server or user
to perform an action before it can download new mail or apply a new template. Ajax techniques enable
web applications to behave more like Windows applications because of this.
Smooth Interfaces
An interface that doesn’t have to be changed is almost inevitably a user interface that is easier to use.
Ajax can cut both ways here in that you can use it to modify parts of the interface and simply confuse
users by changing the ground beneath their feet. In theory, by making subtle alterations, you could aid
the user’s passage through an interface or wizard and speed up the process.
Simplicity and Rich Functionality
As shown in the previous examples, some of the most impressive Ajax applications are those where you
had to look for the Ajax functionality, such as Basecamp. If Ajax can be used to make your applications
simpler while improving the user’s experience, then that must be an improvement.
Drag and Drop
Drag-and-drop functionality is one of the neatest features of most software applications, from Windows
Explorer to Windows Desktop. It doesn’t strictly qualify as Ajax functionality. It’s something that’s been
possible for a great many years in web applications, even before the introduction of the
XMLHttp
Request
object. Most developers seem to opt for Flash or some similarly heavyweight solution rather
than using the JavaScript and DOM solutions. In the reassessment of user-interface creation techniques
that Ajax has introduced, drag-and-drop functionality can be used to manage front-end changes, and
then these changes are submitted via Ajax to the server. For example, you drag several items on the
screen into new positions, and then you log out. Later, when you come back, those items are located in
the same positions.
With such a host of benefits, it might be difficult to imagine why everyone isn’t switching over to using
Ajax applications. There are definitely quite a few pitfalls, though, to consider.
When Not to Use Ajax
Once you’ve learned Ajax techniques, you shouldn’t go back and tear up all your old web pages and
start again. Rather, you should consider how you could improve the usability of your pages and
whether Ajax is a solution that will help improve them. Without advances in usability, you might as well
not bother at all.
18
Chapter 1: Introducing Ajax
04_106754 ch01.qxp 2/9/07 6:15 PM Page 18