We have trapped for onBeforeUnload, but not onUnload. Should be straighforward to code up.
Are using the
remember mefunctionality in the Identity object?
Nope, no remembering.
Tried hooking onto onbeforeunload but the browser seems to be in a hurry to exit. It see an alert('!') I placed just before the remote call but I never get to the remote method...
Did you use any callback function or special return value that might have made your case work correctly?
Thanks in advance,
If the function bound to onbeforeunload returns a non empty string, the browser will prompt the user if they want to leave using the non empty string in the question.
Not sure if this helps in your case though!
The strange thing is that if I call
alert('1'); // the remote call alert('2');
I see the 1, press enter and the browser closes. One would think that at least I would see the 2 (on IE7)
OnBeforeUnload won't do it too, because that event is also fired when you press: back, forward, reload, form submit and leave the page by clicking a link.
AFAIK there is no waterproof solution for this.
I managed to get it work in IE7, but it doesn't work well in FF.