Sunday, December 16, 2007

What's AJAX?

Everybody's talking about Ajax, and practically nobody actually has a clue as to what it actually is!

AJAX, n. acronym: Method of making HTTP server requests using Javascript code, and fetching the server response without reloading the web browser. Short for Asynchronous Javascript And XML. Uses the XMLHTTPRequest Javascript object.

Ajax in a Nutshell:
A way to hit your server and get some data from it without making your poor user reload the whole stinkin' page. (You can send data to the server, too, such as form submissions.) The HTTP request is normal, just done from Javascript! And no reloads!

Wha? XML?
Despite the name, XML doesn't have to be involved. Some Ajax packages let you offload data formatting work to your back end so you can return HTML and even Javascript instead of serializing stuff. Prototype.js is one of them.

The road from here:
Code it by hand, use a Javascript toolkit, or use a Javascript/server-side scripting language framework. Ruby on Rails and its clones have Ajax support baked in. For other languages, your best bet is one of the pure Javascript codepackages to the right.