[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to know that a window is still open



I'm glad it's worked, so far.  I wish we had an "enumerateWindows" function
that would tell us the IDs of all open windows.  That would be cool.  For
the time being, though, I think we have to rely on setting values somewhere
that won't go anywhere in a reload or a resize.  Okay, so there's cookies
and there's "hidden" form events.  A person on comp.lang.javascript has
talked about using an alternative cookies syntax (not documented, and not
yet verified as *safe* by Netscape) that works like this:

document.cookies.cookiename

where cookiename is a name you think up.  This appears to create a temporary
cookie that survives reloads and resaves.  It's a lot easier to use than
cookie functions, and seems well suited for this kind of thing.  You might
try experimenting with it to see if it works for you, but do remember that
it's undocumented.  I'm still hoping to hear a favorable word about it.

-- Gordon
http://gmccomb.com/javascript/


At 04:15 PM 3/20/96 +0100, you wrote:
>Thank you very much for valuable replies to my question, or questions.
>After receiving answers from Gordon, John Ray and Richard Bullington,
>I finally learned how to recognize that a given window is a top-level
>window, or not.
>
>Summary:
>   The simple test if (window.name=="") really works (also on UNIX, Gordon).
>   My mis-understanding was that I replaced 'name' in the line above,
>   with a real window name (e.g. helpwin, setupwin etc.), but it must be
>   exactly 'name' (name is a property, isn't it?).
>
>But I did not succeed with the second problem (which seemed simpler):
>How to know that a window which was opened by me is still open? I know
>that an obvious solution is to remember value returned from open() and
>then use it in close() method. But I do not want to remember it because:
>1. There are problems how to protect stored value over reload and resize.
>2. I am opening some windows from href (with target), so I do not have
>   any returned value.
>I think that should be a method how to ask about a window whose name is
>known. Unfortunately, I do not know how to ask...
>
-- Gordon
http://gmccomb.com/javascript/


--------------------------------------------------------------------
For help about the list, please send a message to 'majordomo@obscure.org'
with the message body 'help'. To unsubscribe, send a message to
'majordomo@obscure.org' with the message body 'unsubscribe javascript'.
List archives and pointer to FAQ: http://www.obscure.org/javascript/