Prevent Parent Reload From Window.Open

W

windfall1

I have a classic asp page that on the onload event, calls a function
which opens an aspx popup

<body ... onbeforeunload="MM_confirmIELeave();"
onunload="MM_confirmNSLeave(this);">


<script language="JavaScript" type="text/javascript">
<!--
var checkLeaving = true;
function MM_confirmIELeave() {
<%Response.Write "var exit_offer = window.open
('../exitpopups/ExitPopUp1.aspx?val=...'
,'exit_offer','scrollbars=no,width=500,height=280')"%>
if(exit_offer != null){
exit_offer.opener = window;
exit_offer.focus();
}
}

//-->
</script>

Use the Response.Write event b/c there are some server variables
sprinkled in query string that I am not showing in the example. Also,
not showing the onUnload function call, but its the same.

The problem is this. When the user clicks on the back button, the
unload event is fired, which is fine, but the parent browser is
reloaded, which I want to suppress. I have read on other posts how to
do this if the window.open method is called from an onclick, but how to
I prevent the parent refresh when window.open is called from
onbeforeunload? Returning false or null does not seem to work in this
case. Behavior in FireFox or Netscape is fine, no parent reload.
Thanks in advance.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,708
Messages
2,569,346
Members
44,650
Latest member
LuckyVivo

Latest Threads

Top