Friday, 17th June 2005
AJAX is not the panachea for web development
Yesterday i posted about AJAX and how wonderful it is. Well today i highlight a couple of observations that some one might consider when deciding to use AJAX for his/her web-application. First and most basic is the fact that it is client side scripting which can be turned off at anytime by the user. So relying on it for core functionality is probably not wise at all.
First of all Ajax isn't a technology. It's really several technologies, each flourishing in its own right, coming together in powerful new ways. Ajax incorporates XHTML and CSS, asynchronous data retrieval using XMLHttpRequest and JavaScript binds everything together.
Another issue is the fact that data retrieved using AJAX merely replaces content on the current page and doesnt cause a page replace, the browser history (navigator.history) is unaffected. This is why most external links on my page open in a new browser (using target="_blank") so that the history is unaffected. Certain jaavscript functions relying on history (not a good idea) would fail on this account.
But perhaps the major issue (Atleast to me) is that although the content of the page has changed, clicking view-source in the browser reveals on the html retrived from the original source (i.e. the inital content) and not the changed content. This is a bit of a bummer.
So for instance in my site. If you browse from artice to article, then use the back button (or possibly forward button) you arent taken to the prev (next) article, rather you will taken to the web page you opened previously. If after a while you visit a new webpage and then hit the back button. It will take you to the URL of my website which you last visited, most likely the index page (Home page).
If you read through my article and/or tried experimenting with AJAX you might wonder if Ajax is just another name for XMLHttpRequest? No. XMLHttpRequest is only part of the Ajax equation. XMLHttpRequest is the technical component that makes the asynchronous server communication possible; Ajax is our name for the overall approach described in the article, which relies not only on XMLHttpRequest, but on CSS, DOM, and other technologies.
Ajax gives interaction designers more flexibility. However, the more power we have, the more caution we must use in exercising it. We must be careful to use Ajax to enhance the user experience of our applications, not degrade it.
Posted by Nikhil on Friday, 17th June 2005 in TechnoBabble