Some developers view AJAX view as the silver bullet for every scenario; however, AJAX introduces its own set of hazards. Tony Patton takes a look at six major drawbacks to developing with AJAX.
AJAX combines the power of existing Web technologies to build powerful user interfaces that offer benefits often found in desktop applications. Over the past couple of years, Web developers have embraced AJAX in their own development efforts as well as via third-party toolkits.
Once you use an application built with AJAX, it's easy to see the benefits: The user experience improves, as page reloads are reduced, and features such as automatic type-ahead facilitate data entry.
Some developers view AJAX view as the silver bullet for every scenario. However, AJAX introduces its own set of hazards in various areas, which include: development time, browsing history and experience, search engine interaction, accessibility, server load, and security. Let's take a closer look at each of these areas.
It usually requires more development time to build an application using AJAX than using other approaches. Plus, learning a new technology like AJAX provides it own set of delays before properly understanding and using it.
In addition, when developers jump on the AJAX bandwagon, you should make sure that they don't use it for everything.
Browsing history and experience
Search engine interaction
Another issue emerging from the dynamic nature of AJAX is a lack of interaction with search engines. Search engines like Google require a page URL and use words on the page as one aspect of its approach to ranking pages.
AJAX is not the most accessibility-friendly development paradigm. AJAX makes the browser act in a way that is different than its original design; for instance, Back and Forward buttons no longer work as expected, and there is no URL for some AJAX content.
These issues should remain in the forefront as you develop an application (regardless of whether it uses AJAX). You can apply the techniques I discussed in the section about browsing issues.
AJAX is not supported in browsers on mobile phones and PDAs, so these devices can be used as a reference point for developing applications that are accessible to everyone. O'Reilly's Ajax: The Definitive Guide does an excellent job of stressing accessibility while using AJAX.
Server load and bandwidth can be an issue when delivering AJAX-based solutions. These solutions often use AJAX to provide features like type-ahead searching in text boxes or loading data in the background. The user may see fewer page reloads, but the server calls are still there.
It is worth considering whether the backend server can handle countless simultaneous calls to the server when many users are using the type-ahead feature. An overworked server can lead to an interrupted user experience with lags in loading data asynchronously. Displaying interim messages like "Loading" can alleviate user concerns because this lets them know something is happening rather than being presented with a blank page.
Security has always been an important issue with Web applications, and AJAX is no different. Like any other application that uses the HTTP protocol, data is sent as clear text. For this reason, no sensitive data should take a ride via HTTP using AJAX or any other technology.
Make a well-informed decision
There are times when AJAX is applicable, and there are times when you should choose another approach. Be sure to consider potential issues with AJAX before putting it to use in your next application. A hybrid approach is usually the best solution with AJAX because it provides certain features in the user interface and other technologies used in other facets of an application.
Is your organization embracing AJAX? What, if any, problems have you encountered with delivering AJAX-based solutions? Share your experience with the Web Developer community.
Additional AJAX resources on TechRepublic
- AJAX, more than a cleanser.
- Download: Investigate AJAX: How it works, how it evolved, and what it's good for
- Download: Encapsulate user-interface functionality into AJAX components
- Free framework looks to simplify Ajax development
- See how the XMLHttpRequest object is the heart and soul of AJAX
- Process XML with the XMLHttpRequest object
- AJAX: The Right Goal, but Often the Wrong Tool
Tony Patton began his professional career as an application developer earning Java, VB, Lotus, and XML certifications to bolster his knowledge.
———————————————————————————————————————————-Get weekly development tips in your inbox Keep your developer skills sharp by signing up for TechRepublic's free Web Developer newsletter, delivered each Tuesday. Automatically subscribe today!