AJAX - rules to live by

December 3, 2007

Ajax, or Asyncronous Javascript And XML, has been around for a few years now. Some programmers have done great job using this technique. Below are some rules to live by:

  • Ajax to Enhance, Not to Function. The most important thing in creating a quality website is to make it work. At a first visit if not everything works fine, the user won’t come back. So, make everything works using standard page refreshes and try to use Ajax to your site.
  • Always Let the User Know What’s Going On. If the user will know every moment in what phase is he will have the impression of control. There is nothing more worse than to click on something and for a couple of seconds nothing happens. If the response for that request can’t be immediately displayed, users can be shown a progress bar or something similar. Ajax is a relatively new technology and imagine that a user that see nothing happen will believe the website is down. I suggest using an unobtrusive message that fades in and out gracefully.
  • You Did It With Ajax? 90% of users and also programmers don’t know what Ajax is and why it’s so cool. I appreciate a good Ajax script, but does anyone else? Likely not. Unless you have a website geared towards Web Professionals, try to hide “Made Using Ajax” message. People don’t care what technology you use as long as the website functions.
  • Ajax at the End. Delivering the web project is the number one goal, so add your Ajax functionality toward the end of the project or after the website is done. People may say something like: “It’s not done, but look at how this box gets updated without the page being refreshed!”.
  • The Security Rules Still Apply. The URL of your Ajax may be hidden in your code so that most users don’t see it. Make sure to scrub the GET and POST variables before doing any Ajax script processing.
  • Ajax Saves Load Time…But Your Javascript Library Doesn’t. Your Ajax code saves a user from a page refresh, which allows for the header, footer, and navigation to not be reloaded? It is cool, isn’t it? Your javascript library might be 80kb? Not cool this situation. All you can do is to load your library when needed, and don’t add any more code than you absolutely need for the page. Exchanging load times, in this case, isn’t efficient or user-friendly.

 

Post a comment

Name (required)

Mail (will not be published) (required)

Website

*
To prove you're a person (not a spam script), type the security text shown in the picture. Click here to regenerate some new text.
Click to hear an audio file of the anti-spam word