Page 1 of 1

Warning before leaving page

PostPosted: Mon Sep 10, 2012 10:37 pm
by Sn3akyP3t3
Its a users right to decide to leave a webpage, but some days there just isn't enough coffee to keep mistakes from happening. I've caught myself a few times navigating my Subsonic Tab playing music away to my homepage or something accidental such as pressing a hotkey that took me off the current page. I suggest implementing a javascript (client side) method to ask the user if he/she wishes to leave the page before navigating away. This will prevent interruption of song play.

A quick and dirty how to can be seen here, http://help.dottoro.com/ljhtbtum.php
and a test here, http://jsfiddle.net/AlienWebguy/4fNCh/

Note not all browsers support onbeforeunload either in HTML or in Javascript. Opera for example doesn't support any of that particular event.

I understand the ethics conversation behind onbeforeunload in the general web perspective, but this is for a dedicated app that the user is in charge of. http://my.opera.com/community/forums/to ... ?id=286462

Re: Warning before leaving page

PostPosted: Tue Sep 11, 2012 12:11 am
by BKKKPewsey

Re: Warning before leaving page

PostPosted: Wed Sep 12, 2012 10:00 am
by Cook66
I hope to see this as an option users can enable/disable at their leisure.