P
perrog
Hi!
What is the expected behaviour when you send an XmlHttpRequest just
before the page is about to unload? I'm sending a XmlHttpRequest on an
onClick event, and I can inspect that the request is sent and
responded in the network traffic, but my onReadyStateChange handler is
notified with an error.
It took me some time to deduce what the real problem was, and I think
my browser begins to tear down the XmlHttpRequest when the page is
about to unload. Therefore, the request is sent, but the browser
cancels before the response is processed and onReadyStateChange is
notified with an error.
I'm using Safari/KHTML.
I searched W3's draft specification,
http://www.w3.org/TR/XMLHttpRequest/
but could not find any answer.
Should the browser wait on XmlHttpRequest completion before the page
is unload? Or should the browser cancel pending XmlHttpRequests when
the page is about to unload?
What is the expected behaviour when you send an XmlHttpRequest just
before the page is about to unload? I'm sending a XmlHttpRequest on an
onClick event, and I can inspect that the request is sent and
responded in the network traffic, but my onReadyStateChange handler is
notified with an error.
It took me some time to deduce what the real problem was, and I think
my browser begins to tear down the XmlHttpRequest when the page is
about to unload. Therefore, the request is sent, but the browser
cancels before the response is processed and onReadyStateChange is
notified with an error.
I'm using Safari/KHTML.
I searched W3's draft specification,
http://www.w3.org/TR/XMLHttpRequest/
but could not find any answer.
Should the browser wait on XmlHttpRequest completion before the page
is unload? Or should the browser cancel pending XmlHttpRequests when
the page is about to unload?