Addressing Ajax Design Issues
Ajax is a new ball of wax when it comes to Web applications, and as such, new rules about how the interface should and shouldn't work are emerging. Those rules have not been formalized yet, but the Ajax community is discussing them. Before launching into creating your own Ajax applications, consider the following design issues.
Breaking the Back button and Bookmarks
Leaving the user in control
Ajax applications can seem to take on a life of their own because they operate behind the scenes. And they can communicate with the server even when the user doesn't want them to — as when the user makes a typing error. You can imagine how you'd feel if you'd just entered a typo and it was immediately stored in a database by an application that didn't ask you if you wanted to store anything.
So, to give your applications a good feel, here are a few tips for putting users in control:
- Don't whisk data away for storage until the user really wants to store it.
- Remember that, ideally, your application is supposed to respond to events caused only by the user. Users can find too much server-side validation disconcerting because it creates the impression that you're correcting them at every keystroke. Don't forget that one of the design principles of graphical user interfaces (GUIs) is that the user should be in control, that they should direct the action.
- And don't forget to offer the user a way of undoing errors.
Remembering all the different browsers
As with any Web application, it's worthwhile to keep in mind that there are many different browsers around, and your Ajax application should be tested in the ones you want to support.
As of this writing, Internet Explorer and Firefox make up about 96 percent of browser use, and the rest (Opera, Safari, and so on) are each in the 1 percent or less category.
Avoiding a sluggish browser
Ajax applications can be large, and when they start using up resources like memory and CPU speed, you've got to be careful. A large application can use up a huge amount of memory, especially if you're not careful about getting rid of large objects that have been created.
Handling sensitive data
With Ajax, it's easy to send data without the user knowing what's going on. In fact, that's part of the whole client/server connection thing that makes Ajax so popular. But it's also true that the user may not want to send the data you're sending.
It's best to be careful about sensitive data. The Internet is not necessarily a secure place for sensitive data, after all, and if you start sending social security numbers or credit card numbers without the user's permission, you could wind up in trouble. So give the users the benefit of the doubt — ask before you send sensitive data.
Creating a backup plan
Showing up in search engines
Google searches billions of Web pages for the text that its users search for — but if the text you display is loaded into a page based on user actions, not on browser refreshes, Google isn't able to see that text. So bear in mind that if you want to make your page searchable on search engines like Google, you've got to give your page the search terms they need. (You can store your keywords in a <meta> tag in the browser's <head> section, for example, which is where search engines expect to find them. See this site for more information on that.)