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

We need to standardize the standardization process...  Never heard of
WHATWG.  I note that Microsoft isn't a participant.  What page is it on?


-----Original Message-----
From: Mike Wilson [mailto:mikewse@hotmail.com] 
Sent: Tuesday, January 06, 2009 11:48 AM
To: Shropshire, Andrew A; 'Boris Zbarsky'
Cc: public-webapps@w3.org
Subject: 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

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 17:36:37 UTC