AJAX - Abused Javascript And XML
Recently I’ve begun my foray into the web developing world, where I was asked to develop a site for a small start up company. After a year of operation, my client decided it was time to revamp the website in order to impress her bigger clients. “Flashy” was the buzz word thrown about during our initial discussion regarding the redesign.
By that time I had already decided to investigate AJAX technologies, and apply them to this project. (Some of you who know me might know how much I shun Full Flash websites, and was reluctant to use it despite the term “flashy” used a few times). And in a short time I was using the MooTools JS library to perform most of the grunt work.
Having the MooTools library granted me a considerable speed boost in developing, and I had an impressive and “flashy” gallery frontend coded in 2 nights (that surprised even me, a newbie in this arena). By that time I was hooked. Images were loaded dynamically, with images resizing and fading into view. Then the terrible blow came when I passed it on my friends to try it.
Lo and behold, it died. Turns out my site doesn’t render very well in some other browsers. Not only that, it was completely inert without Javascript!
Thus I embarked on a google-quest for the holy-grail, and came across numerous articles on both sides of the epic battle. It was then that numerous “flaws” of AJAX was revealed to me. But the main problem, however, was me! I was abusing AJAX, and that worked against me. Which brings me to the first point: just because something can be done easily doesn’t mean you should do it.
The speed at which I was developing AJAX lured me into thinking that I could use it for the entire site. This meant that it suffered from many userability issues that was prevalent with Flash websites. I was falling into bad habits again without noticing it!
And what are the problems?
- Firstly, one cannot guarantee that Javascript is enabled.
- Secondly, most experienced internet users would be most comfortable with the “backspace” or back button. AJAX destroys this functionality. Sure , there are workarounds for it, but it doesn’t do the job half as well. Furthermore, if a person were to press the back button, and go forward again, you lose data that he was trying to access previously
Of course, one could easily build 2 version of the site. But while that allows Javascript to gracefully degrade, it doesn’t take away the problems associated with abusive AJAX in the first place.
So my conclusion is that one should always take care not to abuse AJAX. Building entire sites for public view is not a good idea. However, so called RIAs or Web Applications use AJAX as a given. The key here is being able to distinguish between an Application and a Site. If all you’re making is a site, you’re better off not using AJAX for anything at all.
The best way to look at it is to imagine yourself using your site. Turn off Javascript. Then try navigating your site. If you have difficulty, its time to rethink your strategy.
Tags: Rants





