Page 1 of 2

Are you sure you want to leave this page script

PostPosted: Sat Jul 30, 2011 3:37 am
by techgump
I would like a small script like:
<script type="text/javascript">
window.onbeforeunload = function(){ return "Are you sure you want to leave the page?"; }
</script>

This will prevent the sudden unload of the page on an accidental "back" click or close.

Re: Are you sure you want to leave this page script

PostPosted: Sat Jul 30, 2011 3:50 am
by Ratburntro44
Good idea. This could help a few people.

Re: Are you sure you want to leave this page script

PostPosted: Sat Jul 30, 2011 8:42 am
by Lopdo
hmm... I tried it and I don't like it. I hate sites that keep bothering me when I want to close them. Misclicks aren't probably that common to warrant this, you will have to be more careful

Re: Are you sure you want to leave this page script

PostPosted: Sat Jul 30, 2011 3:29 pm
by Ratburntro44
Good point. It could be helpful, but would more often than not be annoying.

Re: Are you sure you want to leave this page script

PostPosted: Sun Jul 31, 2011 11:30 am
by Joshua
I keep accidentally signing out and it really annoys me

Re: Are you sure you want to leave this page script

PostPosted: Sun Jul 31, 2011 3:03 pm
by Ratburntro44
Signing out? How do accidentally press the sign out button?

Re: Are you sure you want to leave this page script

PostPosted: Mon Aug 01, 2011 9:51 am
by Joshua
idk, maybe i'm just really twitchy or clumsy or something

Re: Are you sure you want to leave this page script

PostPosted: Mon Aug 01, 2011 12:51 pm
by Ratburntro44
Hmm. Either way, most people wouldn't need a leave page script.

Re: Are you sure you want to leave this page script

PostPosted: Mon Aug 01, 2011 8:36 pm
by Joshua
i would though, thats all that counts :mrgreen:

Re: Are you sure you want to leave this page script

PostPosted: Mon Aug 01, 2011 10:01 pm
by Ratburntro44
Then why don't you open up command prompt and enter in some code to make that happen just for you?