AJAX (abbreviation for Asynchronous JavaScript and XML) is a great technique for creating dynamic and interactive web applications which are better, faster and more user friendly. It is not a new language; rather, it is a new way to use existing standards. It allows you to retrieve data asynchronously from the server without interfering with the display and behavior of the existing page. In essence, a javascript communicates directly with the server through the XMLhttp Request object and data is sent from the server to the page in the background silently. Traditionally, getting information from a database required creating a form using the GET or POST method with a submit button. While the advantages of using AJAX are quite obvious, like reducing connections to the server (scripts and style sheets only require to be requested once), sections of pages can be loaded individually, etc, there are a few disadvantages too, which few will tell you. Although there are ways to handle these cons, you need to know this before you hire someone to do your AJAX work. These are:
1. Bookmarking a page for future reference is a common practice among internet surfers. However, it is difficult to bookmark a particular state of the AJAX application when it is dynamically created. So if you think your visitors need to bookmark at stages, you can use the URL fragment identifier (the part of the URL immediately following the “#” character.
2. Visitors often use their browser's back function to see what they had viewed earlier. Unfortunately, a dynamically created page does not register itself with the browser's history engine. This means that when you click on the back button, it would take the visitor to the last page visited “before visiting the Ajax enabled page”, and not the earlier state of the Ajax enabled page. Overcoming this is also possible; you simply use an invisible iframe to trigger changes in the browser's history and also change the anchor portion of the URL (same as we did in the above example – following #) whenever Ajax is running and check for the changes.
3. A visitor using a browser that does not support Ajax or javascript will not be able to use the full functionality; so some alternative has to be thought of beforehand. While this is diminishing, some percentage of surfers will always be there.
4. The initial loading time for a page may be comparatively higher, depending on the data required to be presented when handling request objects.
5. Some search engines may not be equipped for Ajax because of the dependence on javascript. So if your pages are all Ajax based and you want all the search engines to index them, you may require to include direct links.
6. There are no adopted best practices to test ajax applications because of lack of a standards body. The current available tools fail to understand the models and data protocols in an ajax enabled event.
7. Devices like PDAs, mobiles and other screen readers may not have the necessary support to interpret ajax enabled pages.
8. There could be some user privacy and security issues if the ajax developer is a newbie. So make sure to tell your developer to take care of any security holes that a hacker could take advantage of.
This article may be republished on a webpage as long as the author's bio is left unchanged and the links in the bio are active. If you want to publish more of my articles you can get them at http://www.bharatbhasha.com/author.php/Nirjara%20Rustom