I would like to make the user confirm that she wants to leave my single-page application. ExtJS 4.1 provides the onWindowUnload
in which I would like to plug in a Confirm
dialog.
If the user decides to proceed closing the tab/window an Ajax request to the logout URL should tell the server-side that the user has logged out.
Is the above approach possible?
Is it possible to plug the onWindowUnload
event in ExtJS MVC controller
?
P.S. User leaving single-page app can be any of the following: browser tab close, browser window close, browser back button, browser forward button.