Anne van Kesteren

The XMLHttpRequest Object

I just love the fact that we now have /TR/XMLHttpRequest. Anyway, The XMLHttpRequest Object at the W3C. It still needs some work, you can help out if you like.

Comments

  1. Why not supply XMLHttpRequest.onload? Because IE is the only browser not supporting this? For me it's hard to see any reason for something such complicated as this two-step onreadystatechange way.

    Posted by JZ at

  2. Why not supply XMLHttpRequest.onload?

    That was exactly what i was thinking... wouldn't that make the whole process much easier?

    Just splitting up the onreadystatechange in to:

    Or am i saying something stupid here?

    Posted by Walter at

  3. Another factor is that onreadystatechange isn't available in Gecko-browsed web browsers when doing synchronous requests.

    More info on the events and their quirks can be found in XMLHTTP notes: readyState and the events.

    I, for one, think onload should be a supported event as well.

    Posted by Robert Nyman at

  4. Note that onload is not really an event in most browsers. I think that in Gecko it is and we (well, I) want other browsers to make XMLHttpRequest implement EventTarget as well, but until that happens they are not really events, just methods invoked at the right time. Given that Internet Explorer does not support onload, onerror et cetera we might put that in a later version. Not sure about this version.

    Posted by Anne at

  5. The problem with trying to tidy up the design is that you cannot change the browsers that have already shipped. Site developers like to suggest improvements to specs but if those suggestions make it into the spec, they won’t use them if the spec disagrees with IE and if the IE way also works with other browsers.

    Posted by Henri Sivonen at