AJAX W3C Standardization

Well, it’s been long enough. It’s time to polish off the ol’ blog and start blogging again. So, while everyone’s down in sunny Orlando blogging about php|tek, I’m sitting right here 12 hours away (by car; 1.5 hours by plane) in Atlanta in my new home office, enjoying the scent of new office furniture – which is most likely just the scent of pressed fiberboard, or something. But, hey, I don’t care how it smells as long as it’s a good tax write-off.

Speaking of the new home office, I’ll take a short little aside to remedy something of which Lig reminded me: “if it’s not blogged, then it didn’t happen.” In short, I have a shiny, new job as an Engineer with Art & Logic, and that’s all I’ll say about that for now.

Now, for the more interesting piece of this post, as indicated by the title. Apparently, the Web APIs Working Group at the World Wide Web Consortium (W3C) published on April 5th a working draft for a forthcoming recommendation on the XMLHttpRequest object, the JavaScript object that gives AJAX it’s power.

The draft does not yet introduce any new features to XMLHttpRequest and serves merely to advance the purpose of the Web APIs WG, which is to document existing APIs, as well as develop new ones. Nevertheless, I think this is a great step forward for standardizing AJAX. Currently, developers must take into consideration both the (now) standard way of creating an XMLHttpRequest object:

var req = new XMLHttpRequest();

and the MSIE way of creating one (which was actually the first way of doing it, though it uses Microsoft’s ActiveX technology):

var req = new ActiveXObject("Microsoft.XMLHTTP");

A standard would provide grounds for agreement between browser makers and developers. Unfortunately, as history has shown, browser makers – ahem, Microsoft – are wont to follow their own whims, creating their own standards. The working draft of the recommendation addresses this problem:

The XMLHttpRequest object is implemented today, in some form, by many popular Web browsers. Unfortunately the implementations are not completely interoperable. The goal of this specification is to document a minimum set of interoperable features based on existing implementations, allowing Web developers to use these features without platform-specific code. In order to do this, only features that are already implemented are considered. In the case where there is a feature with no interoperable implementations, the authors have specified what they believe to be the most correct behavior.

The recommendation will seek to provide developers with a standard form of AJAX that will work across all browsers. This is only one of the W3C’s first forays into Web API standardization, though, and it appears that they have many others planned.

The W3C has consistently provided Web developers with good, solid recommendations over the course of the past twelve years, and I laud their efforts as they continue their work by providing recommendations for Web APIs.