<div class="gmail_quote">On Sun, Jun 26, 2011 at 12:38 PM, Sreeram Ramachandran <span dir="ltr"><<a href="mailto:sreeram@chromium.org">sreeram@chromium.org</a>></span> wrote:<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">


I did see a couple of confirm() calls in beforeunload. The examples I<br>
found were also annoying ("Are you sure you want to leave? Yes/No"),<br>
but I can imagine those could instead have been more useful ("Do you<br>
want to save some state? Yes/No"). I think if there are indeed such<br>
uses, they can be transformed into  something that returns a non-NULL<br>
value in beforeunload and then saves state.<br></blockquote><div><br></div><div>"Do you want to save some state? Yes/No" seems like a valid use of confirm because there are 3 possible actions users can take:</div>

<div><ol><li>Don't leave</li><li>Save state and leave</li><li>Discard state and leave</li></ol></div><div>If the site just used beforeunload, it can't distinguish 2 and 3.</div><div><br></div><div>- Ryosuke</div>
<div>
<br></div></div>