I am trying to implement a basic popup that asks the user if they really want to leave a page similar to what will happen on this site if I try to close the window halfway by writing this message.
I understand that this is usually disapproving, but I have every reason to want to do this.
This works for me using the following code:
function confirm_exit(e) {
if(!e) e = window.event;
e.cancelBubble = true;
e.returnValue = 'Are you sure you want to leave?';
if (e.stopPropagation) {
e.stopPropagation();
e.preventDefault();
}
}
However, I would really like to show a message when they leave the page if they do not leave by clicking one of the two links.
(I just realized that it sounds like I can get them to click ads or something else!)
, . ( , , , - " , , ?).
, ?
.
.