AJAXing Off[20050701]
My last BOAF session on Tuesday was titled Creating Next Generation, Highly Dynamic, Off-line Capable Web Applicatios With HTML and JavaScript (whew) led by the Ajaxian boys, Dion Almaer and Ben Galbraith. It sounded really funny; how can you have an offline web application?
Well it turned out the title was a bit misleading. The offline application demonstration was only a small part of the session; it was basically a heavy user of JavaScript and DHTML, and they made mention of sealed JARs which I will look into later. But that doesn’t matter; it introduced me to AJAX.
Asynchronous JavaScript and XML is just a fancy way of saying DHTML, something many of us abandoned in the late 90s, early 20s. With the big two at the time (IE and Netscape) providing different almost-but-not-quite-hey-we-broke-the standard implementations for the DOM model and CSS, most people washed their hands of it, and went off to make things that actually work. Anything more complex then simple forms, floats, and rollovers became the domain of Flash.
Way back in those wild frontier days of the net, Microsoft introduced a JavaScript object to IE called XmlHttpRequest, allowing script to (duh) send and receive XML from the browser. Now, most people ignored this as yet another attempt by Microsoft to “improve” a standard instead of actually fixing their app.
But a funny thing happened. While no one was looking, IE and Netscape reborn as Mozilla improved, their DOM models actually working. And most importantly, XmlHttpRequest became a standard; Apple Safari’s even supports it.
So how what can we do with this mysterious object? The answer is everything … at least where the web is concerned. Using JavaScript, we can send information back to the server WITHOUT having to resubmit the page. Don’t believe me? That’s how the Google Maps control works. As you drag and drop the map around, in the background requests are being made to grab the next slide and rewrite the next page.
This may actually be an answer to a technical problem we have at work, which I will blog later. In any case, it is used in JSF, Shale, and Tapestry. I look forward to seeing all of this in the future, and thank Dion and Ben for the wonderful session that clearly explained Ajax and showed its power. Oh, and thanks to Ed Burns, the man when it comes to JSF, for the quick preview on how this would all work with that framework.
