What's the Stupidest Ajax Application You've Ever Built?
I think mine would have to be the email checker on an account that got almost no email. You would go to the Web page and it would say "You have 0 mail messages." The 0 would change if a message came in, but since that account got no mail, it would never change. I tested it by sending mail to the account, and it worked. But it was absolutely pointless. There were better mail checkers available five years ago, and I didn't have to have Firefox or IE running to use them. When one of my co-workers saw it she said "What's it do?" When I explained, she asked "Why?"
Before Building an Ajax Application Always Ask Why
If the only reason you're building the application in Ajax is because "Ajax is cool" or "my boss told me to use Ajax," then you should seriously evaluate your technology choice. When you're building any Web application you should be thinking of your customers first. What do they need this application to do? What will make it easier to use?
Why Not Something Else?
It can be very tempting to use Ajax simply because you can. On one site that my team was working on, there was a tabbed section of the page. All the content was stored in XML in a database and when you clicked on the tabs, Ajax was used to rebuild the page with the new tab data from the XML.
This seemed like a good use of Ajax, until you start thinking of some of the issues with it:
- The tabs cannot be bookmarked. So customers can't save the information they want.
- Search engines don't see the data that isn't in the first tab, because they can't access the Ajax.
- If one of the tabs had a lot of information, it could take a long time to load on a slow connection. And because Ajax doesn't indicate anything is happening it looks like the page is broken.
The thing that was interesting, is that this Web site had similar pages in the past that didn't use Ajax. They delivered the content either with hidden divs or separate HTML pages. There was no reason to use Ajax other than that Ajax was cool, and our boss had suggested we look for places to use it.
Ajax is for Action Not Content
If you're going to put up an Ajax application, or just something Ajax-like on your Web site, first determine if the data you're accessing changes. The point of the asynchronous request is that it makes requests to the server for information that has changed faster - because it's happening while the reader is doing something else. Then when they click a link or button (or after a set amount of time - whatever your distinction is) the data shows up right away.
If your content or data never changes, then you shouldn't use Ajax to access it.
If your content or data only rarely changes, then you probably shouldn't use Ajax to access it.