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.
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
Why not supply
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?
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.
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
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
onerror et cetera we might put that in a later version. Not sure about this version.
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.