If you send two asynchronous requests in quick succession I presume this involves two different instances of the XMLHttpRequest.
Are you supposed to allocate a different onsteadystatechange function to each different instance of XMLHttpRequest (which seems a bit awkward). I have tried to use a single "pipe-like" function and then try and identify the instance that caused the event by inspecting event properties such as window.event.srcElement. This yields null.
Maybe one could keep an array of request object instances and test then one at a time for correct readystate to find which request has returned.
Any "right" way of doing this. Many thanks.