I want to inform my server that the user has closed the tab / browser window with our application.
I found out that starting an ajax call with async:false tied to window.beforeunload evet will work and that will happen. Sorting...
window.onbeforeunload = beforeunload; function beforeunload() { setSendingPowerStatus(false, true); }
Thus, in chrome, the user closes the window and the function setSendingPowerStatus(false, true); , which in its implementation makes a synchronous call, and when the browser completes the tab. In FF, on the other hand, the user is prompted with this warning box βAre U sure you want to leave the page?β.
My question is how to make ajax call in onbeforeunload without showing any dialogue ??? I want to say that I want to make an ajax call before the window is closed without bothering the user ...
I also tried to return false also from my handler function, but without luck too ...
source share