W3C home > Mailing lists > Public > public-webapps@w3.org > January to March 2009

RE: Proposal: Detecting when the user leaves a page due to hitting the back button or typing in a URL or going to a favorite

From: Mike Wilson <mikewse@hotmail.com>
Date: Mon, 5 Jan 2009 17:53:10 +0100
Message-ID: <BAY116-DAV116919181115C4EC294A9AA4E10@phx.gbl>
To: "'Boris Zbarsky'" <bzbarsky@MIT.EDU>, "'Shropshire, Andrew A'" <shropshire@att.com>
Cc: <public-webapps@w3.org>
Message-ID: <00ff01c96f56$16ff4af0$0a01a8c0@mikedeskxp>

Boris Zbarsky wrote:
> Shropshire, Andrew A wrote:
> > 1. Allow the unload event to be cancellable from script.  This 
> > will allow web designers to recreate the modal flavor of 
> > desktop apps like MS Excel that prompt with "Yes/No Cancel" 
> > when there are unsaved changes.
> Doesn't the onbeforeunload event do this?  Or is your issue 
> wanting to change the text and/or provide that one extra option 
> (instead of the two dialogs one would need right now to give all 
> three of Yes/No/Cancel as options)?  If so, would it make sense to 
> extend onbeforeunload to do what you want instead of changing
> unload?

Yes, that's the way I would go. I've also wanted to be able to 
customize the onbeforeunload dialog in some projects. 

There's some write-up here:

Care must be taken though to ensure there is always a way to 
continue even if a custom dialog in an evil page "removes" the 
Continue option.

Best regards
Mike Wilson
Received on Monday, 5 January 2009 16:54:01 UTC

This archive was generated by hypermail 2.3.1 : Friday, 27 October 2017 07:26:13 UTC