I have a flash game in which I try to save state when the user closes the browser tab. It uses the following jquery code:
function sendRequest(url, params) {
$.ajax({
type: "POST",
async: false,
url: url,
data: params
})
}
$(window).unload(function() {
document["flashGame"].saveBeforeUnload();
});
- Firefox: working correctly
- Chrome: works correctly when it reboots , but not when it closes tabs or closes the browser
- IE (all versions): not working at all
I want it to work correctly in all browsers, but the most important thing is Chrome (many of our users have IE).
Flash correctly calls sendRequest (in all browsers checked with a warning), so I do not believe that problems arose from Flash, but it could be.
source
share