Prevent Parent Reload From Window.Open

Discussion in 'Javascript' started by windfall1@gmail.com, Oct 27, 2005.

  1. Guest

    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.
    , Oct 27, 2005
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Joshua Beall
    Replies:
    26
    Views:
    220,260
    AndreiKaa
    Jun 29, 2007
  2. vseshan204
    Replies:
    3
    Views:
    3,602
    Vangi
    Jul 27, 2009
  3. PWalker
    Replies:
    1
    Views:
    133
    David Lionetti
    Feb 24, 2005
  4. Sonnich

    forcing parent window to reload

    Sonnich, Nov 16, 2006, in forum: Javascript
    Replies:
    2
    Views:
    116
    Sonnich
    Nov 16, 2006
  5. Raffi

    Parent Window Reload

    Raffi, Jan 17, 2007, in forum: Javascript
    Replies:
    7
    Views:
    208
Loading...

Share This Page