subject: AJAX - Disadvantages and Remedies [print this page] AJAX - Disadvantages and Remedies AJAX - Disadvantages and Remedies
AJAX is Asynchronous JavaScript and XML, it is a group of interrelated web development techniques used on the client-side to create interactive web applications. With Ajax, web applications can retrieve data from the server asynchronously in the background without interfering with the display and behavior of the existing page. The use of Ajax techniques has led to an increase in interactive or dynamic interfaces on web pages. Despite the name, the use of XML is not actually required, nor do the requests need to be asynchronous. But many people don't know that Ajax is not a technology in itself, but a group of technologies.
You might have heard a lot of advantages of Ajax, but there are only very few people who would actually talk about its disadvantages. Well every technology has its drawbacks and flaws, and Ajax being a group of technologies has its own drawbacks.
Let's discuss some of its drawbacks and flaws along with the remedies for it.
v Due to its dynamic nature, Ajax interfaces are often harder to develop when compared to static pages. The use of AJAX interfaces can increase the amount of requests to web servers and the database. This will ultimately lead to slow response times and timeouts. To get rid of this problem we can possibly reduce the amount of requests to the web server to the minimum, and you are not able to do that then the only option is to upgrade your hardware to support the increasing amount of requests.
v If you have pages created with successive Ajax requests you will find that when the user tries to use the back button it does not redirect to the previous page. The reason why this happens is because AJAX requests do not automatically register themselves with the browser's history. So you can use iframes to make changes in the browser's history to change anchor portions of the URL.
v If you want the crawlers to crawl your website then you will need an alternative way to access your site because many web crawlers cannot execute JavaScript.
v Another problem that users find is that whenever they try to bookmark a part of a page; and when you have bookmarked it and if you try to go back to it, it will not take to that exact page rather will take you to the homepage. Here you can use a URL fragment identifier to keep a track of the pages the user tries to view.
v Smartphones generally do not have Javascript enabled browsers; so these users will not be able to surf your website. The only solution for this problem is to use non-JavaScript ways to access your site.
v Due to the high number of requests sent to the web server, it can create security problems for your website. Though this is one of the easiest problems to solve but it takes a lot of time in the development stage of the website. Make sure that someone is not trying to use SQL injection or a duffer overrun attack.
These were some of the disadvantages of Ajax and with the solutions provided you will be able to overcome some of the above mentioned problems while working with Ajax.