How AJAX is like pepper
Don't go completely crazy with AJAX. Use good judgment on how and when to use it.
Since my last post of when to use AJAX, a lot has changed in the ways of AJAX programming. New tools, ideas, and techniques are constantly being developed to support this latest and greatest craze.
Some developers just want use the latest buzzwords and technologies in their applications just to prove that they can build such a beast. Sort of like an "I climbed Mt. Everest" battle cry.
However, most applications shouldn't be built completely with AJAX from the ground up. Of course, AJAX and DHTML are two completely different animals. But that's another post altogether.
Just a Pinch
AJAX should be used sparingly like pepper on food. Just "sprinkle" it on some applications, don't dump an entire load of AJAX into your application. The more you add to it, the more complex it will become to maintain. Keep it simple and use it with good judgment.
My advice of where to put AJAX or how to learn AJAX?
Write your application with your favorite server model (ASP.NET, PHP, ColdFusion, etc.). Make sure it's functional before you even think of adding AJAX or you'll muddy the waters even more.
Then look your application over. Where would AJAX benefit your users? Here are a couple of suggestions:
- Do you have an OnChange event on a dropdown list that completely refreshes the page? Instead of refreshing the page, make an AJAX call, return JSON, and fill in the proper fields.
- Waiting for a large page to load? Load the main page and then load the subcomponents through AJAX.
As you keep building web applications, you'll start to see places where AJAX does make sense.
How do you integrate AJAX into your application?