W3C home > Mailing lists > Public > whatwg@whatwg.org > February 2010

[whatwg] prompts, alerts and showModalDialog during beforeunload/unload events

From: Jonas Sicking <jonas@sicking.cc>
Date: Thu, 11 Feb 2010 19:42:32 -0800
Message-ID: <63df84f1002111942j39a71402t2a1e8be309c4b1de@mail.gmail.com>
2010/2/11 Scott Gonz?lez <scott.gonzalez at gmail.com>:
> On Thu, Feb 11, 2010 at 9:55 PM, Tab Atkins Jr. <jackalmage at gmail.com>
> wrote:
>>
>> I commonly see them put to *good* use by editting applications,
>> warning you if you attempt to leave the page without saving. ?It has
>> saved me from accidentally lost effort just in the past few days in
>> both my email and one of my wikis.
>
> I use dialogs in this fashion as well. Users get very frustrated when they
> accidentally leave a page with unsaved content and this is the easiest
> improvement for most developers to make.

However you can accomplish this using the onbeforeunload return value.
No need to open modal dialogs using showModalDialog/input()/alert()
etc.

Though I'm not sure what exactly Ojan is proposing we forbid?

/ Jonas
Received on Thursday, 11 February 2010 19:42:32 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:59:21 UTC