Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New Coder
    Join Date
    Jul 2004
    Posts
    98
    Thanks
    0
    Thanked 0 Times in 0 Posts

    A Popup and Redirect on One Page

    Hey guys!

    I am working on a page that will create a popup then send the parent page back to the previous page using the history.back function. I am using the history back function because our website uses session ids and there is no way to link to a specific page. The code below works in IE but not in FireFox and it takes a little longer then I would like.

    Code:
    <html>
    
    <head>
    <title>URL Redirect</title>
    <meta http-equiv=refresh content=0;URL="javascript:history.back(-1);">
    </head>
    
    <script language="javascript">
    function bustOut(){
       var newWin = window.open("http://LocationOfPopupPage", "subWindow","height=500,width=700,resizable=yes,scrollbars=yes");
    }
    window.onLoad = bustOut;
    </script>
    
    <body onLoad="bustOut()">
    <p align="center"><br>
    <font face="verdana, arial, helvetica"><span style="font-size:8.5pt;font-family:verdana, arial, helvetica">
    <strong><br>
    This The document is located on an internal site. The document will now be opened for you from the internal site</strong></span></font><p align="center"><font face="verdana, arial, helvetica"><p align="center"><font face="verdana, arial, helvetica"><span style="font-size:8.5pt;font-family:verdana, arial, helvetica"><strong>You will now be redirected back to the previous page</strong></span>
    </body>
    </html>

  • #2
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    18,079
    Thanks
    203
    Thanked 2,542 Times in 2,520 Posts
    Sorry - pressed wrong button

  • #3
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    18,079
    Thanks
    203
    Thanked 2,542 Times in 2,520 Posts
    window.onLoad =" bustOut()";
    </script>

    <body onLoad="bustOut()">

    The second onload will overwrite the first.

  • #4
    New Coder
    Join Date
    Jul 2004
    Posts
    98
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Is there a way to get the redirect to take place while the user is viewing the popwindow. Whats happening now is the page opens in a pop which is great then once the user closes the pop page it takes it about 3 to 4 seconds for the parent page to change

  • #5
    New Coder
    Join Date
    Jul 2004
    Posts
    98
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I know I could something like this if I had access to the popup source files

    Code:
    <script language="Javascript" type="text/javascript">
    changeParent(){
    parent.window.location="javascript:history.back(-1);";
    }
    </script>
    Code:
    <body onUnload="changeParent()">
    since I dont have access to the source files that the page is calling I was hoping there was a way to start a process on the parent page so that while the user is viewing the popup window its changing the page so that when they closed the pop they were at the correct page already


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •