What I'm trying to do is create a popup anytime the page comes out or is deleted. Right now i have
<script type="text/javascript"> function box() { var r=confirm("Message"); if (r==true) { window.location.href="yes.html"; } else { window.location.href="no.html"; } } </script> <body onunload="box();">
I have 2 problems with this:
It shows only the field, if you really move far from the page, refresh, new url, etc. If you exit a tab or browser, a window will not appear.
No matter which button you click, it just sends you where you tried to go initially, it never sends you to no.html or yes.html .
Can someone tell me how this is possible?
source share