A Look At AJAX: Pros and Cons
After taking a look at what AJAX is last week, this week I'm taking a look at the pros and cons of using it in web design. Like any tool, it has its strenghts and weaknesses, and it's important to understand those to better utilze its functionality.
PROS
- Update Only What You Need To On A Page - Take the poll on the right as an example. Currently, when a vote is submitted, a whole new page is loaded from the server into the browser. However, if I were to implement the poll using AJAX, I could have only the poll section of the page reload when a vote is cast.
- Save Server Processing and Bandwitdth - If you've got a lot of pages where only a small portion of the page needs to be changed, then implementing AJAX can cut down on the number and size of calls to the server.
- Separation of Data From Layout and Style - Using AJAX allows you to keep the data separate from layout and style by only loading the data that needs loaded and maintaining the main layout and styles already defined by the initial page.
CONS
- Not All Users Have JavaScript Enabled - For security reasons, a percentage of users have blocked JavaScripts from running, so these users won't see AJAX functionality. This can be accounted for in your code in terms of site functionality, but you won't get the same performance benefits with these users.
- Not All Users Have The Same Version of JavaScript Installed - So, any bleeding edge functionality my error out on some computers. This may result in the need for more testing on different versions of JavaScript available in different browsers to make sure they all work as expected.
- AJAX Can Break Site Pageflow - AJAX functionality breaks the use of the back button in most browsers, so any segment of your page you implement it on needs to have a way to get back to if there is any need to users to do so.
- Most Search Engines Can't Reach AJAX Content - Since search engines don't typically, enable JavaScript support most search engines won't be able to reach AJAX enabled content. In order to make sure that this content can still be indexed, the equivalent data will need to be available at a public URL.
As you can see, there are certainly some cases that make better choices for AJAX content, and some where implementing AJAX can be more trouble than it is worth. Take the time to decide how you wante to use AJAX on your site to determine if it is the best choice for your site.
Next week, we'll start taking a look at how to implement basic AJAX functionality on a site. Be sure to swing by then!


Hey Robert, thanks for the feedback.
With 1 and 3, you're right that I made a mistake when putting the article together. Guess I need to work on my proofreading and fact checking.4
With point 2, I wasn't intending to suggest that AJAX was a means to create the separation between content and style. It's just that AJAX pretty much forces to you make this separation in order for it to function optimally.
And for point 4, I'm pretty sure that's the point I'm making: that if a page is only loaded up through AJAX, then the major search engines will not be able to index it.
Thanks again for you input!