erenpasa
asked on
javascript cancel close window
hi to all,
(For Internet explorer 7.0)
1-i want to show a message to user when close explorer window. i've done it but when i explore in same domain the message appear always. I just want to show message when user try to close window. not as surf same domain. if user go another domain so show message too..
2-Is there any way to cancel window close?
(For Internet explorer 7.0)
1-i want to show a message to user when close explorer window. i've done it but when i explore in same domain the message appear always. I just want to show message when user try to close window. not as surf same domain. if user go another domain so show message too..
2-Is there any way to cancel window close?
window.onbeforeunload = closeWindow;
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
2- you can cancel window close by returning false with
window.onbeforeunload = function() { return false; }
BUT you also can't leave the current page to another, which means it also can't be done.