I swore to myself a while ago that I wouldn’t write anything about Ajax, but I’m about to break this promise, mostly due to writing like this, and other various bits from around the web that quite simply just don’t appear to make any sense. So here are my thoughts, which are based on theories untested and mysteries unsolved.
- XMLHttpRequest has been around for many years, first in Microsoft’s IE as an Active-X object.
- The object is now supported in some form by all major browsers in use today, with some quirks.
- There are two methods of interest. open(), which prepares a connection to a URL, and send(), which makes a request asynchronously (most of the time) to the URL.
- There are a few properties of interest as well, namely onreadystatechange (an event handler you pass a function to), readyState (the current state of the object), and responseText (which is the actual response returned by the request to an URL)
Passing the condensed information through Jeff’s Even Superer Information Condenser, we end up with this:
Notice how my Information Condenser says XMLHttpRequest is “At the core of Ajax.” So what else is Ajax comprised of, you may be asking yourself? Well, to answer that question, you’ll have to go back and re-read the Adaptive Path article I linked to above. If you want my version (which I’ll assume you do, because I’m like that), here goes: No one fucking knows.
My take on Ajax is basically that Ajax means using XMLHttpRequest to get information from a remote URL without doing a full page refresh. Exhilarating, eh? Which kind of makes me wonder why we have full on “Ajax frameworks” like Atlas, replete with special updatePanels and Control Toolkits. I personally fail to see why it needs to get so damn complicated. Maybe it’s time to play around with it a little bit to see what the big deal is.