The Pros and Cons of Using Ajax
Some of the many benefits of using Ajax in web-based applications include the following:
- Improved user experience
- Asynchronous processing
- Reduced server hits and network load
- Platform and architecture neutrality
- Multibrowser support
- Faster page renders and improved response times
We discuss each of these as we progress through the hours of this book.
The Downsides of Using Ajax
Now let's discuss the drawbacks of using Ajax or, more precisely, areas where Ajax can fit and those where it can't. Although Ajax comes with a lot of advantages, there are quite a few downsides to using Ajax in your web applications. The major drawback is its massive usage and dependency on JavaScript. It should be noted that JavaScript is implemented differently for various browsers, such as Internet Explorer, Netscape, Mozilla, and so on. This becomes a constraint especially when you need to make Ajax work across browsers.
Added to this, you do not have support for JavaScript in mobile browsers. So, taking Ajax's dependency on JavaScript into consideration, Ajax might not be well suited for designing mobile applications.
Usage of Ajax makes your web page difficult to debug, increases the code size of your web page, and makes your web page prone to potential security threats. Moreover, its usage—and the asynchronous operations thereafter—tend to increase the load on the web server. When using Ajax, making your application cross-browser compliant is rather difficult (although not impossible, of course), and the Back button of your web browser does not work.