2

In my MS CRM 4.0-application, there are several things to do before the window is closed. So I have to stop the window from closing in the onbeforeunload-function and do my stuff in different locations. This works already, but only if I show the dialog by returning some message in my onbeforeunload-function and the user chooses "stay on page" (or something like this)

Is it possible to skip this dialog and stop the window from closing?

I know there are several reasons, why this shouldn't work, but, e.g. in my CRM-application it is neccessary.

Chris Baker
  • 49,926
  • 12
  • 96
  • 115
abc
  • 2,285
  • 5
  • 29
  • 64
  • 8
    No, it's not possible, and thank goodness for that. :-) – Pointy Dec 13 '11 at 15:47
  • @Pointy I +1'd your comment on principle (developers, please don't hijack my browser!), but there **is** a frustrating lack of modality in web-based software that would come in handy in certain application use-cases. One can create simulated modal dialogs in javascript, but a page refresh breaks out of them with a hammer. – Chris Baker Dec 13 '11 at 16:00
  • 1
    What are some of the things you aim to achieve before a user closes a window? For things such as saving/caching, your best bet is to do things like that periodically, or after a user does something (other than close a window). – Jeffrey Sweeney Dec 13 '11 at 16:08
  • A client has to be informed. He does some things, like closing other windows and so on. But it doesn't work if I close the window before – abc Dec 14 '11 at 10:38
  • Surely they get the option? IE: Save changes/close windows or not, up to you. If there are mandatory tasks that they should have done, you can always catch it in the back end, right? No need to beat them with their own browser... – ndtreviv Jan 05 '12 at 17:03
  • Don't open popups, half of the problems will be gone. –  Jan 27 '12 at 21:11

0 Answers0