Prevent Parent Reload From Window.Open



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

<body ... onbeforeunload="MM_confirmIELeave();"

<script language="JavaScript" type="text/javascript">
var checkLeaving = true;
function MM_confirmIELeave() {
<%Response.Write "var exit_offer =
if(exit_offer != null){
exit_offer.opener = window;


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 method is called from an onclick, but how to
I prevent the parent refresh when 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