www.webdeveloper.com
Results 1 to 3 of 3

Thread: how to access my opened window once i browse away?

  1. #1
    Join Date
    Feb 2008
    Posts
    136

    how to access my opened window once i browse away?

    Say I have two files myindex.php and windowLand.js...

    myindex.php looks like this:

    Code:
    inside myindex.php
    
    <script src="windowLand.js"></script>
    
    <html>
    <body>
    content...
    </body>
    </html>
    
    
    then windowLand.js looks like this:
    
    <script>
    content = "<html><body>.....</html>";
    newWindow = window.open('pizza.html', 'my_cool_window', ....etc);
    newWindow.document.write(content);
    </script>
    So I create a new window inside myindex.php. my_cool_window gets opened. windowLand.js contains the opener for the new window.

    Now I browse away from myindex.php...my new window is still opened but I've lost the opener to the window...how do I gain access to the new window again????

  2. #2
    Join Date
    Nov 2002
    Posts
    4,473
    This will give you a handle to the window without changing the URL:
    Code:
    newWindow = window.open("","my_cool_window");

  3. #3
    Join Date
    Mar 2007
    Location
    U.K.
    Posts
    1,127
    Quote Originally Posted by YourChild
    Now I browse away from myindex.php...my new window is still opened but I've lost the opener to the window...how do I gain access to the new window again????
    Write this into the new window's markup:
    Code:
    <script type='text/javascript'>
    
    setInterval( function(){try{ opener.newWindow=self; }catch(e){} }, 500);
    
    <\/script>

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles