When Should You Use AJAX?

AJAX, or Asynchronous JavaScript and XML, was probably the most-hyped web programming technique in the last two years. It’s no surprise, as it enables you to do a lot that couldn’t have been done just a few years ago.

AJAX is being used in more and more places, often when it doesn’t need to be…and when it shouldn’t. With all the talk about how you can use AJAX for everything, the real question is when should you.

You should use AJAX in places where it will improve the user experience. One example is with polls. Why should a full pageload be required just to vote in a poll (or view the results)? That’s a waste of your users’ time, and a waste of your server resources.

Do not use AJAX for loading your main content, though. It’s not a good idea. I’ve seen a few sites that have tried it, and it doesn’t work that well. You have to come up with extra solutions for search engines, because they can’t understand your JavaScript trickery (you thought the dreaded “text-only version” link only applied to Flash sites? ). You also cause problems for people using some browsers (Safari, IE5, etc).

Basically, you want to use AJAX for things where an extra pageload would be irritate the heck out of everyone. Suppose you have a star-rating system, like on Netflix. Wouldn’t it be horrible if you had to sit through a page refresh every time you rated a movie? Use your own judgment.

  • Aleen

    If you are defied by AJAX and want to have better experience, then you
    may want to try AJAX Webshop because it features IDE and visualization
    and allows beginners to develop Rich Web applications quickly. Let’s
    look at some of its features:

    Based on standard component library it allows Ajax IDE in the pattern
    of rapid application development (RAD)

    Integrated development and management tools are available. Easy-to-use
    visual Unified Modeling Language and visual IDE; complete component
    and object-oriented development pattern

    Rich Web component library

    Troubleshooting IntelliSense support, code editing support, project
    release and deployment support.

    Java, PHP, C#, VB support

    Compatible with IE, Firefox