Ajax is often mistaken for a programming language, when in reality it is more of a standard or technique used to create better, more interactive web applications. It is used to create more responsive web pages by loading certain areas of a page, instead of an entire page. In this tutorial, and the ones that follow, we will learn to work with it to build dynamic web sites.
Before we actually learn the techniques, it may help to understand why you would want to and compare the advantages and disadvantages of using Ajax. I would say for the most part that the advantages far outweigh the disadvantages, but you may disagree.
So without further ado, here are the advantages:
-Consistency
Ajax allows for a consistent view in that it does not need to reload the entire page like traditional methods. Instead it can reload specific elements, so the page does not need to flash on and off or reposition itself.
-Fluidity
Instead of loading different pages to display information, you can load the data in the same window, making your web page feel and behave more like a Flash or a desktop application.
-Usability
As stated above, you can make your web pages feel more like an application, allowing for enhanced user experiences and easier controls.
-Bandwidth Friendly
Since Ajax updates portions of the web page instead of the whole thing, and handles data in the background, it typically results in faster page loads. And honestly, even if the page does not actually load faster, it feels that way because the page does not flicker or seem to change much at all.
-Interactivity
Due to the increased speed of the pages loaded (or the illusion of increased speed), visitors to your site are more likely to interact with all of the elements on your site. If you have a rating system on your website or a choice of options, in traditional web sites the user chooses some options and has to wait for the page to reload and store the data before displaying more options. With Ajax, it all happens on the fly. I know when I visit a website and after every decision the page has to reload, I get pretty irked, pretty fast. Yet if just the page section updates, I tend to stay.
That isn't to say that as Ajax gets more popular and we get more used to it, that we won't get impatient with it as well. Consider cooking something in the microwave for five minutes. It seems like a hassle to us now, but back when they were first invented, it was a godsend.