![]() |
Javascript alert box on exit??
I have been searching high and low but can't seem to find what I am looking for. Basically I want an alert box with ok/cancel or yes/no to popup when someone exits my website. Say I were to have the alert say "Do you want 100% FREE PORN?"'' and they click ok it takes them to porn.com, but if they click cancel it just exits. Can anyone help me on this subject?? It is irritating the shit out of me. Any help would be appreciated! :helpme
|
<body onunload="function()">
<script type="text/javascript"> function function() { alert("hello world"); } </script> I think |
well didn't read your thread properly... you should use some dialog thing instead of alert there.
|
actually when I come to think of it... the onunload event fires after the unload so you might wanna look for another event :)
<script type="text/javascript"> function MsgOkCancel() { var fRet; fRet = confirm('Are you sure?'); if (fRet==true) { //fire unload event here. } } </script> but just consider these bumps... can't remember which event that fires before onunload. |
All times are GMT -7. The time now is 01:55 PM. |
Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123