On Mon, Mar 2, 2009 at 7:59 PM, bill walton <[email protected]> wrote:
>
> Hello Hiro,
>
> On Mon, 2009-03-02 at 08:04 -0800, Hiro wrote:
>
>> Is there a way to catch the browser close event?
>
> There is no reliable way to do this.
<html>
<head>
<title></title>
<script language="JavaScript">
<!--
cancel = 0
window.onbeforeunload = bunload;
function bunload()
{
if( cancel != 1 )
{
dontleave="You must click the submit button below to complete the sharing";
return dontleave;
}
}
function cancel_bunload()
{
cancel = 1;
}
//-->
</script>
</head>
<body>
Please stay on this page!
<br><br>
<a href="confirm_close.html">A link the user shouldn't click</a>
<br><br>
<form method="post" action="confirm_close.html">
<input type="submit" name="submit" value="submit" onclick="cancel_bunload()">
</form>
</body>
</html>
--
Greg Donald
http://destiney.com/
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---