I have window.unload hooked to save my form data in emergencies when the user just closes their browser. I send this using ajax via POST. This works in IE9, Chrome etc, but not in IE10 where the form data is empty (using GET is a workaround).
I can't find any references to this behaviour, is it documented somewhere?
I assume, you are using code like this:
with an
inOnUnload()
-function being defined like the following:The problem with this in IE10 is that it seems to cancel the request, after the document has finally been unloaded. This happens before the form data had a chance to leaf the client. To send data in
onunload
events in IE10, you must use theasync = false
parameter inXMLHttpRequest.open(...)
.The following works fine for me: