W3C works to standardize XMLHttpRequest

The World Wide Web Consortium‘s (W3C) new Web API Working Group has released a working draft of the official specification for the XMLHttpRequest object, which is at the heart of AJAX.

The XMLHttpRequest object, which enables JavaScript code to make requests to the server and process the responses, is supported in most current browsers, including Mozilla/Firefox, Safari, Opera, and the upcoming Internet Explorer 7. Internet Explorer 5/6 offers the functionality of XMLHttpRequest through an ActiveX control of the same name.

According to the draft, the first version of the specification aims to document the cross-browser functionality that is currently available only. Features that only exist in one browser will not be included in the specification, nor will any new features. In the few cases where the various browsers disagree on how a given feature should work, the specification will describe the “most correct” behaviour, as determined by the spec’s authors. What should result is useful documentation for web developers of just what they can rely on and use today. At the same time, the document will provide a target that will enable new implementations to ensure interoperability.

Prior to this W3C spec, the only vendor-neutral specification for just what XMLHttpRequest should do was to be found in the Web Hypertext Application Technology Working Group’s (WHAT-WG) Web Applications 1.0 Working Draft specification, which contained plenty of ambiguities and issues. Heavily based on the WHAT-WG’s work, the W3C’s spec cleans up many of those issues, and is generally a more solid foundation for developers.

Free book: Jump Start HTML5 Basics

Grab a free copy of one our latest ebooks! Packed with hints and tips on HTML5's most powerful new features.

  • Geeee

    ohhh I think it’s good to have a standard for the AJAX to guide people on how to use it to the maximum and in a the right direction, what do you think guys?

  • AJ

    While I do think it is good that the W3C have finally gottent their act together, is this yet another standard that is going to be ignored, or worse still, interperted in yet another of several different ways by the various browser providers.

    While standards should remain the core focus of the W3C, something has to be done about the Software Vendors and their interpertations of standards, most noteably those whole have considerable market share. Should there also not be a drive to provide an interperative document too, to guide the software vendors (Personally I think a few of them will need instructions provided in Crayola!).

  • Dr Livingston

    well…

    for those vendors that ignore standards, and who continue to ignore those said standards, then a simple answer to that would be just not to use their browser…

    that is one reason firefox has really taken off and that is why microsoft has finally started to pay attention to standards as they know that they can’t continue to ignore them;

    the uptake of firefox has made that clear to them. as for developers who ignore standards i ask them what the -BEEP- are they doing in the IT industry?

    beat it…

  • http://www.sudokumadness.com/ coffee_ninja

    While I think a standardized XMLHttpRequest interface is a fantastic idea, I think the W3C needs to put a little more time into getting the many standards they’ve already written adopted. That means more marketing, less engineering. Go to their website and take a glance at their website and count how many recommendations they’ve written. Then count the number you would find useful if they were adopted. Then count the number that actually have been adopted.

    More marketing, less engineering. More “How-To’s” on the stuff they’ve already got, less stuffy recommendations that confuse novices and bore experts.

    On a side note, I thought I’d share a related anecdote from work today.

    A consultant sat down at my computer today to log in and give someone a tutorial on their web application, called DocBase Direct. When the site loaded in Firefox and failed to work, the consultant wasn’t the one that got an earful for hocking an IE-only piece of crap on us. It was me for using… *ahem*… a “nonstandard browser.” I suppose the popularity really is the only standard that matters, unfortunately.

  • http://www.johandeklerk.co.za j996_adict

    staight A, coffee_ninja, i agree with you totatlly

  • Dr Livingston

    a non standard browser? firefox? wtf? you know just what i would have done yes?

    safe to say that consultant wouldn’t sit down at my desk again, to put it politely… but i agree with you on the point about all the technical specifications which most people can’t understand, myself included at times.

    a plain english version would carry more influence i think :)

  • svanpoeck

    @coffee_ninja: DocBase Direct seems to work now on FF, just went there to have a look ;) The only issue seems with the video which is displayed in too small a frame…

    Otherwise, I agree with you on the lack of standards marketing/promoting by the W3C. They’re lucky to be the reference for web standards, because if not, nobody would even care going through their opaque docs any longer…

  • http://www.sudokumadness.com/ coffee_ninja

    DocBase Direct seems to work now on FF, just went there to have a look ;) The only issue seems with the video which is displayed in too small a frame…

    I shouldn’t have blasted DocBase the way I did. It really is a good system, if you’re content to use Internet Explorer. I should have specified that it is logging in to the actual system that seems to be the problem. The home page I linked to is fine AFAIK.

    I guess that consultant’s “talking out the wrong end” fired me up a bit ;)

  • dot_coder

    W3C standards are inportant, and would it be nice if everyone cared.

    From my perspective, my code is always standards compliant, so having AJAX standardised just means I’ll have to go through and assess the way I’ve learnt AJAX. Hopefully, I am not going to be massively in breach of the standards.

    Fun isn’t it?

  • Wolf_22

    I’m so tired of standards. I’m no dummy, so I won’t say that I don’t understand them because I do. It’s just that sometimes I wish there were only one browser so that there would be one set of code for it (so to speak).

    As far as the XMLHttpRequest; I have to agree with coffee_ninja. I feel that the internet (although fairly old now) is still so very young, and that it has a very long way to go. This is both good and bad. Good because it means that there will be plenty of work for individuals such as yourself and me, but bad because it means that there will always be new things to have to overcome (like code, methodologies, OS’s, etc).

  • jayboots

    @doc: hey, what’s with the “standards” rant? Guess who invented and first delivered an implementation of XMLHttpRequest — before ANY standards body thought to work on it and before any competitor decided to follow suit in their own unique ways? Let’s not forget either how many custom extensions to the standards that Mozilla and FF has incorporated. I love FF and I detest the “other guy” but there’s no point in being huffy about it because nearly every vendor is quite guilty of offending the specs in one manner or another. MS’s apparent “lack” of standard support has far more to do with them not making any significant browser development in the last 4 years more than anything else.

  • http://www.sudokumadness.com/ coffee_ninja

    Let’s not forget either how many custom extensions to the standards that Mozilla and FF has incorporated.

    I’m just curious what Mozilla, recently, has added that is nonstandard… of course back in the day when Mozilla was synonymous with Netscape, there was “innovation,” a.k.a. proprietary extensions, coming from everyone ranging from marquee to embed to layer to ActiveX. Of course as happy as I am to have standards today, you have to give both Mozilla and Microsoft credit: they gave we the designers these proprietary extensions to fill the gaps in the original HTML specifications. They gave us what we needed at the time.

  • siteman123

    My company relies on a developer who insists he is on top of web standards. He uses Dreamweaver and so does half of the world when creating web sites. He insists that the errors that occur during validation tests are purely because of the extensions he inserts. He insists that he does things to the web sites that make them better than if they were compliant and that every error message that is thrown up during validation tests he can account for. He gets compliments about the look of his sites and I help create useful functionality. Together we are building a business. Any comments from you guys would be greatly appreciated.

  • Arnold Daniels

    Hahaha… typical…

    Microsoft has invented this technology back in april 2000 and early adopters have been using it since mid 2000. Now that everybody is starting to use it, W3C has decided come into the picture.
    Back then, Microsoft was already talking about using SOAP for client-server communication and serveral persons created XMLRPC implementations using a XMLHttpRequest object.

    I can’t blame the devopers of Microsoft for not taking a third party, standarizing their technology 6 year after dato, to seriously.

    Have a look at the following articles:
    http://www.halans.be/links_ajax.html
    http://msdn.microsoft.com/msdnmag/issues/0400/cutting/
    http://www.vcdn.org/Public/XMLRPC/
    http://www.scottandrew.com/xml-rpc/

  • jayboots

    I’m just curious what Mozilla, recently, has added that is nonstandard…

    Too many to count. From CSS extensions (rounded corners are just the start) to ECMAScript and DOM extensions (eg: window open to support “chrome”) to … well, just about everywhere that a standard wasn’t already decided on or where they were implementing technology that wasn’t covered in an existing standard. For example, Mozilla implemented many technologies without any standardization or public/community (I mean industry wide) review process (eg: from RDF in the early days to XUL, XBL, XPI and others in the current day). I would think that a strict regard for “Standards” would mean not only upholding existing standards but also forging new standards before considering implementing an extension (to avoid fracture/lock-in). Where they wish to “innovate” Mozilla seems quite content to extend before standards are settled. Still, Mozilla is very good of adopting standards once they are ratified so I’ll give them that. Further, while the W3C is a defacto standards body for the web I personally don’t see why they are more qualified to decide some of these issues than any other group — including Mozilla.

  • http://www.primacognos.com bigduke

    1. About damned time.
    2. What about the Load and Save (DOM 3) thingie? This means that it won’t be on the scene until some more time? It is supposed to succeed XMLHttpRequest isn’t it? Opera 8.x is the only browser that supports it right now AFAIK. I think thats a better API than the XHR.

  • http://www.sudokumadness.com/ coffee_ninja

    @jayboots: Excellent points… I hadn’t thought of a lot of the things you mentioned. Of course the CSS rounded corners effect that Firefox has is part of the CSS3 standard. I’m not sure why they named it -moz-border-radius instead of border-radius though. Perhaps its not stable? I dunno. Either way I’m sure when they implement more CSS3 support the -moz name will be deprecated.

    THe problem is that web developement often puts the “cart before the horse” as they say. Mozilla or Microsoft or whomever create some API or technology we find incredibly useful, then everyone else follows suite. Only after we’ve been using four proprietary versions of it for some time does the W3C or ECMA or whomever decide its time for a standard. Correct me if I’m wrong, but this applies to JavaScript/ECMAScript, XMLHttpRequest, the JavaScript Window object, even HTML itself. Am I wrong on this? ;)

    Basically if we sit around and wait for the W3C to standardize everything before we use it, we’ll never get anything done.

  • Spongebath

    coffee_ninja, if the standards were to come first, then ~that~ would be the cart before the horse. Standards are things that arise after a period of common usage; traffic laws, language/gramatical rules, legal concepts, are all examples of things that come about ~after~ (and because of) the experiences of normal people demonstrates a need.

    Standards are not imposed from on-high, they arise from common experience and need.

  • http://www.sudokumadness.com/ coffee_ninja

    My language was a bit backwards I agree :) I guess what I was trying and failed to get at is this: If there weren’t early adopters of proprietary technology, then bodies like the W3C would never have a reason to write a standard. There need to be people ingenius enough to create new tecnology and others bold enough to use it for a standard to ever arise. Otherwise it will never reach the masses that want to use standardized technology.

  • jayboots

    Standards are things that arise after a period of common usage; traffic laws, language/gramatical rules, legal concepts, are all examples of things that come about ~after~ (and because of) the experiences of normal people demonstrates a need.

    Standards are not imposed from on-high, they arise from common experience and need.

    Just to further the discussion a little, I’ll posit that the sentiment in that quote is not necessarily accurate, at least in software. In fact, this seems to talk more to defacto standards — the very type that aren’t that helpful in software just because they tend to lead to vendor lock-in and fracture.

    XML was standardized before it was in common usage but it sprang from a rich tradition of text processing so wasn’t borne out-of the void. Most technologies, though are much like this.

    Why has it taken so long for XMLHttpRequest to be ratified (it still is not — which is odd because it is really a straight-forward technology and nearly trivial extension when you already have a network browser) I’m a little worried that it is just because it was introduced by Microsoft. MS created a defacto standard in that case but to demonstrate fracture, competing implementations varied from MS’s implementation. Perhaps this was for legal reasons, perhaps for technical reasons but one thing is for sure, no other vendor was compelled to follow Microsoft exactly just because there has been no working group to address this (actually, there was, but they sat on their butts waiting for wide-spread adoption which is odd since it has been available in nearly 90% of all browsers for YEARS now).

    The interesting thing is that if a technology like this does not arise from a clear standards body that will be accepted by all vendors, then the first large vendor (ie: large distribution channel) to implement has a very good chance lock the technology for a long time. Does anyone think that XMLHttpRequest would be a big deal if it was only implemented in Firefox and not at all in IE? I hazard to say it would not unless a larger standards body proposed it first and in a way that compelled all vendors to implement the standard.

    I’m no Standards Nazi but I do believe that we would all be better off if all vendors at least made an attempt to work together before implementing. I don’t really expect the likes of Microsoft to play fairly in that regard but though it may be naive, I think it would be of great benefit to all if the likes of Mozilla behaved this way.

    Greetings.

  • http://www.sitepoint.com Matthew Magain

    @jayboots: I agree with most of your comments, except for this one:

    while the W3C is a defacto standards body for the web I personally don’t see why they are more qualified to decide some of these issues than any other group—including Mozilla.

    The W3C is at least partially democratic – Microsoft and Mozilla both have representation in the W3C, as do a lot of other organizations. Unfortunately, democracy is not a catalyst for innovation…

  • jayboots

    @Matthew Magain: Agreed. I carelessly threw that last quote in at the end; truly the W3C has done good, beneficial work and I needn’t be pointing out matters where I think they have stumbled — at least not in this forum. I think we are definately served by bodies like the W3C (or whatng or whomever) that promote interoperability. Unfortunately — and as you suggest — democracy (or some form of it) doesn’t necessarily lead to cooperation, particularly when outside of their group membership, each participant has their own private agendas which they wish to fulfill.

    As we have strayed OT (sorry about that) here are a few things I would like to see: more original work being promulgated first through standards bodies before they get implemented independantly; requirements to also create reference implementations and conformance test suites for each standard issued; a clearer mission that puts more focus on tractable technologies that are already in wide use (or rapidly emerging) and less on the purely speculative and heavily research oriented projects that are incubating (I’m looking at you countless specs concerning the semantic web). Don’t get me wrong — those are important areas to develop I am sure; yet I say let those later technologies leave the research field before they enter the oversight of a standards body since speculative research and standards making don’t quite seem like a workable fit to me.

  • http://www.game-machines.com/ fatnewt

    The big ideas are almost always the product of the private sector — but it’s important that once they enter the hands of the masses, they standardize.

    With the Web 2.0 hype and all the AJAX fun that everyone’s rushing to have, it’s a good time to get everyone on the same page before someone gets the idea that they should somehow pull in AJAX applications with .

  • http://www.game-machines.com/ fatnewt

    … ( that was embed ).

  • Anonymous

    Standards are emergent, not predefined.

    People do something innovative. If other people like it, then they will imitate it. And then the standard is written. The failed W3C standards are the ones that tried to do it the other way around.

    Example: Microsoft invents XMLHttpRequest. Mozilla says “hey, neato!” and implements it too. Then Opera jumps on. Now the W3C writes it down into a standard that everyone can reference, instead of blindly toying with everyone else’s implementations.

    Example: Apple invents the canvas element. Mozilla says “hey, neato!” and implements it too. Then Opera jumps on. I’m betting the W3C will write a standard on this sometime soon.

    Example: With XForms, W3C tries to invent a standard before there is a marketplace implementation. XForms has been largely ignored for the past 3 years.

    It’s PERFECTLY FINE for browsers to come up with nonstandard extensions. If it’s good, then people will imitate, and the W3C will write down the minimum subset–the lingua franca–that everyone needs to understand to successfully communicate.

  • NAL

    Offering a few random thoughts –

    1 – I concur with coffee-ninja’s comment, “I suppose the popularity really is the only standard that matters, unfortunately.” In my experience, businesses will use whatever software their clients/partners are using, good or bad, to avoid compatibility issues., i.e., “Microsoft is the standard”.

    And that’s why we have major market players delivering IE-only sites/software, and why I have had DSL and cable support reps tell me they don’t “support” email applications other than Outlook and Outlook Express.

    2 – What is most likely to get the blame when a web site fails to render properly? The web site, not the browser. Hence the headaches, multiple browser testing, and hundreds of “work-arounds” site designers must contend with. Been there, continue to do that.

    3 – Finally, after mucking about with computers and software for nearly 40 years, I have come to the conclusion that standards compliance can be compared to world peace – we are not likely to get there.

  • toltec7

    Please correct me if I am wrong here, and I realise this is slanting a little off topic, but to my understanding, the w3c define standards well after browsers implement them. And considering that ie is by far the most popular browser, making the smooth running of the web heavily reliant upon it, why then do the w3c always appear to create standards that run contrary to the implementation chosen by ms.
    In most cases, to my uneducated eye, there appears to be neither a right or wrong way to implement a standard, most being a matter of semantics. Yet by implementing standards which the greatest percentage of current websites in operation are not programmed to render correctly, the w3c appears to be waging a war against itself.
    Is it any wonder therefore that some developers view standards with such low regard?

  • http://www.experioronline.com Jenny McDermott

    Response toltec7′s post:

    “Please correct me if I am wrong here..”

    You got it! See below.

    “the w3c define standards well after browsers implement them.”

    I don’t know. Others probably have better information on that than I do.

    “And considering that ie is by far the most popular browser, making the smooth running of the web heavily reliant upon it…”

    IE has been the most popular for some time, but that is changing due in part to its manifold and serious security problems. I subscribe to a number of business magazines, and it’s always interesting to read what they have to say about computer/Internet issues. In the last year or so, I’ve seen several columnists strongly urge readers to convert to Firefox in order to avoid the viruses, worms, and other beasties that come through on IE. For that reason, I wouldn’t say the Web “runs smoothly” on IE; quite the opposite.

    “why then do the w3c always appear to create standards that run contrary to the implementation chosen by ms.”

    More horse-in-front-of-cart-ness here. Microsoft promised way back at version 5.5 they would make IE standards-compliant; then they released it and said (figuratively speaking) “Nyahh! We lied! It’s not standards compliant after all!”

    As another poster pointed out, Microsoft has been represented on the W3C for some time. They presumably go to the meetings and certainly, being the 800-pound gorilla they still are, would be listened to on any issue they cared to bring up. I think it’s more a matter of MS going its own way no matter what than the W3C deliberately creating standards that conflict with MS implementation.

    “In most cases, to my uneducated eye, there appears to be neither a right or wrong way to implement a standard, most being a matter of semantics…”

    I’m not entirely clear what you mean here, but I think you’re probably wrong. By definition, a “standard” is a precisely-defined “right” way of doing something. (Well, pretty much.) Dictionary.com says standard is “An acknowledged measure of comparison for quantitative or qualitative value; a criterion.” Definitions aside, I’ve found from my own experience that if I code pages exactly the way the W3C tutorials tell me to, it looks pretty okay on all the Gecko browsers and usually Opera too. It breaks, as often as not, on IE.

    I won’t list all the advantages of using standards-based code, even though it means using hacks for IE, but this is hardly a “semantic” issue; there are real consequences involved.

    “Yet by implementing standards which the greatest percentage of current websites in operation are not programmed to render correctly, the w3c appears to be waging a war against itself.”

    The W3C doesn’t implement anything. It merely suggests and recommends; browser makers are the ones doing the implementation. It would be more correct to ask why browser makers wage war against the W3C standards.