1. No Profile Picture
    Devshed Newbie (0 - 499 posts)
    I need a way to verify whether a window is
    already open before writing to it to prevent the script from reopening the frame file and wiping out the associated history files. So far I have had no luck with checking for the window name.
  2. #2
  3. No Profile Picture
    Devshed Newbie (0 - 499 posts)

    Two possibilities...

    1- You could write a cookie when you open the window and check for the cookie each time you want to write to the window. Don't forget to change the cookie when you close the window.

    2- Look at pages 176-178 of "The Javascript Bible" by IDG Books. It gives an explanation of the window 'close' property. I don't have time right now - there's alot involved.

    Matthew J. Flynn
  4. #3
  5. No Profile Picture
    Devshed Newbie (0 - 499 posts)
    You can use the "closed" property of a window.

    For instance:

    var winTest = window.open("whatever.html");
    if (winTest.closed)
    alert("Window Closed");
    alert("Window Open");

    You can also use this on the window.opener object:

    if (window.opener.closed)
    alert("Window Closed");
    alert("Window Open");

    The problem I've run into is if you open a window, then go back to the opener window and change URL's. Then try to access the window.opener object from the opened window, you no longer have access.

    "It's not where you're from, it's where you're at." S. Dogg

Similar Threads

  1. Replies: 0
    Last Post: January 17th, 2004, 08:22 AM
  2. open a child window but using parent's code
    By kkong in forum HTML Programming
    Replies: 3
    Last Post: August 27th, 2003, 02:17 PM
  3. Open window with no address to prevent bookmarking
    By mike972 in forum PHP Development
    Replies: 0
    Last Post: September 14th, 2001, 01:22 AM
  4. Replies: 1
    Last Post: September 5th, 2000, 09:01 PM

IMN logo majestic logo threadwatch logo seochat tools logo