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: Tue, 6 Jan 2009 17:47:37 +0100
Message-ID: <BAY116-DAV2E1FAE14B2C65A6242A99A4DE0@phx.gbl>
To: "'Shropshire, Andrew A'" <shropshire@att.com>, "'Boris Zbarsky'" <bzbarsky@MIT.EDU>
Cc: <public-webapps@w3.org>
Message-ID: <014401c9701e$7b02ca40$0a01a8c0@mikedeskxp>

Shropshire, Andrew A wrote:
> 1. Allow the unload event to be cancelled.  This could be 
> done in a way consistent with other cancellable events 

I'll reiterate what Boris has said, and I think most will
agree:

There is already an event for cancelling "leaving the page"
and that is the beforeunload event. It is widely available
and is also being standardized in HTML5:
http://www.whatwg.org/specs/web-apps/current-work/

The current event setup is quite orthogonal and nice in my 
view; you use beforeunload to know when the user is
asking to leave the page (with the option to cancel) and
the unload event to know when the user has decided to
really leave the page.

Making the unload event cancellable would be like making
the load event cancellable - wouldn't make sense.

Best regards
Mike Wilson
Received on Tuesday, 6 January 2009 16:48:30 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 18:49:29 GMT