AJAX debabbled
Since I've covered Javascript and XML in the past couple of weeks, it ties in quite nicely to a hot topic, AJAX. This one gets the seldom-used Geek Factor 4, as AJAX is one of those concepts that everyone seems to be talking about while less than 10% of them has any idea what it means.What is AJAX?
I should mention, to begin with, that AJAX gets tossed around conversationally as if it's a programming language (akin to PHP, ASP, etc.). It's really more of a programming technique, and I hope the distinction will become clear shortly. Unfortunately, the acronym's not terribly helpful: AJAX stands for Asynchronous Javascript And XML, not what I'd call self-evident, except that it obviously has some connection to Javascript and XML.
To demystify AJAX a bit, it's helpful to understand that Javascript, as a client-side scripting language, has one major drawback: it can't access server-side data. One of the advantages of server-side languages like PHP is that they can access huge databases quickly, sending just the results to the web surfer. Since Javascript is already running on the web-surfers computer, it no longer has that luxury. On the other hand, the disadvantage of server-side programming from the data standpoint is that you have to make a new request (in other words, call or refresh a web page) every time any piece of data is changed.
For some data-heavy applications (think Yahoo! Maps, for example), easy access to data on-the-fly would be a huge plus. So, enterprising minds decided to empower Javascript to talk to server-side databases using the data description "language", XML. Once it worked, AJAX was born. In reality, AJAX isn't a new language, just an extended capability of Javascript. As for the "Asynchronous" part, that just means that the database communication happens in the background, while other things are going on. By operating asynchronously, AJAX can pass data back and forth relatively quickly, while allowing client-side web applications to operate more like desktop programs. Essentially, an AJAX-powered web page can refresh in bits and pieces without completely reloading.
What's in it for me?
As a personal favor to me, please don't ask your website developer to use AJAX just because you've heard it's the latest and greatest thing. AJAX can be very powerful if used correctly, but it's also difficult to implement, still pretty much in its infancy, and has drawbacks of its own. You may want to seriously consider AJAX if you're developing a web-based application that has to behave more like a traditional software application, with data changing rapidly (and where waiting for web pages to reload just isn't realistic, performance-wise). Just be aware that such cutting-edge applications will take significant development time and cost.


