HomeCoding & Programming

Drawbacks of AJAX

Like Tweet Pin it Share Share Email

AJAX(Asynchronous JavaScript And XML) is nothing but a technique which uses the JavaScript and XML together to provide the flexibility in interactive web pages. It is used to send a request to the server using the XMLHttpRequest and use the result sent by the server in the web page.

 

Once you use an application built with AJAX, it’s easy to see the benefits: The page reloads time are reduced, and features such as automatic type-ahead facilitate data entry, user experience improves but there are some drawbacks of AJAX, you should take care before developing a page using AJAX.

 

AJAX is using JavaScript it may not work when the JavaScript is disabled.
Any user whose browser does not support AJAX or JavaScript, or simply has JavaScript disabled, will not be able to use its functionality. Similarly, devices such as smart phones, PDAs, and screen readers (very much popular now a days) may not have support for JavaScript/XMLHttpRequest object (AJAX), so a user must take care as a reference point for developing applications that are accessible to everyone.

This requires extra development time to deliver an alternative solution (using the NOSCRIPT tag), when a user has disabled JavaScript support within their browser.

 

Not all browsers support AJAX.Though IE 5.x, 6.x, Mozilla 1.x, Firefox still supports.
Browsers use the different objects to handle this technique, you have to code for each browser, XMLHttpRequest is not supported in older version. No standardization of XMLHttpRequest yet.

 

The Really Simple History (RSH) JavaScript library highlights another major issue with Web applications that use AJAX. There is no browsing history, so Back/Forward buttons become useless.
Pages are dynamically updated (do not automatically register themselves with the browser’s history engine) using the AJAX, when the back button is pressed the full information on the page may not be reflected. The browsers don’t remember the partial page refreshes being done by using AJAX.

 

Bookmarking becomes difficult with AJAX. This is because of the fact that in the browser address bar URL remains same when AJAX requests are sent.
Dynamic web page updates also make it difficult for a user to bookmark a particular state of the application.

 

Use of JavaScript slows down the application. There is definitely a performance difference between showing a static HTML page than processing JavaScript events. The older generation of browsers is really awful in this context. Hence this is one of the serious AJAX drawback for browsers like IE6.

 

One of the drawback is that AJAX based applications are difficult to debug than synchronous applications (which use PHP, JSP, Servlets for complete page refreshes).Though there are tools and browser extensions or plugins/addons to debug AJAX code (Firebug, Fiddler2 etc.)

 

The AJAX code is written in HTML or js files and these are downloaded by the browser. So anyone can see your source code for generating AJAX requests. Once the hackers know the URL and parameters to generate AJAX requests, they can very easily generate hoax in AJAX requests to your server.

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.

 

Due to the asynchronous nature, now user can keep on generating requests even when he has not received response for earlier requests. This can lead to scenario where more requests are generated than the server can handle and hence you are forced to increase the capacity of your servers.

 

AJAX is a lack of interaction with search engines.
If you are developing an application and then thinking of making it seo optimized then better don’t use AJAX (or use minimal), because the search engines don’t understand AJAX and they need a proper URL for indexing the content which is one of the AJAX Drawbacks for websites that want to reach out in search engine results.

 

Server load and bandwidth can be an issue when delivering AJAX-based applications. These applications 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 back-end server can handle countless simultaneous calls to the server when many users are using the type-ahead feature. 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.

 

 

Be sure to consider the above potential issues with AJAX before putting it to use in your application. A hybrid approach is usually the best solution with AJAX because it provides certain features in the UI and other technologies used in other facets of an application.

 

 

Have you encountered with delivering AJAX-based solutions? Share your experience with ScriptArticle.com.