You are here: irt.org | FAQ | JavaScript | Window | Q1475 [ previous next ]
By then it would be too late. The only event is the onUnload event and that is triggered even when they leave the page for another one of your pages. You would need to have a test in every link on your page:
<BODY onLoad="closing=true" onUnload="if (closing) alert('please leave next time by logging off')"> <a HREF="otherpage.html" onClick="closing=false">other page</a>