hello guys,
i'm not sure if there's a way to do this or not..
HTML Code:
<script type="text/javascript>
window.onbeforeunload = askConfirm;
function askConfirm(){
return "Are you sure you want to leave this page? Please close it by saving notes or clicking Send!";
}
</script>
this is what i have so far and it works when the user tries to close the window the alert will appear. My questions is when they click the button save the window closes by itself but the alert will still pop up or when they send the info the window is supposed to close by itself but still the alert will pop up.. now is there a way to apply this askConfirm only when they close the window by clicking the X in the corner?
Thanks
Last edited by stivens; 10-05-2011 at 03:48 PM..
|