[Javascript] Enumerating Other Window

David Lovering dlovering at gazos.com
Fri Mar 21 12:29:36 CST 2003


It isn't quite that simple.

When a program spawns a remote, the parent can do pretty much as you said,
and use

    windowname.document.formname.varname.attribute  -- OR --
    windowname.document.framename.document.formname.varname.attribute
// one or more frames

to call up the bits in the child window(s).

When the child program wants to access items in the parent window, it is a
bit more complicated.

    For a single form, no-frame parent:

    window.opener.document.formname.varname.attribute

    For multiframe, multiform parent(s):

    window.opener.parent.document.formname.varname.attribute -- OR --

window.opener.parent.document.framename.document.formname.varname.attribute

  It gets REALLY tedious when you start embedding things inside <OBJECT>
declarations, as it appears with
MicroSloth's defective DOM structure you can only go from the parent to the
child, and not backwards.  I won't even attempt to give you a path map for
this -- it is too complicated to explain lucidly in a few sentences.

  The reason the second 'document' declarations are needed inside pages with
frames is that the frame acts as a document boundary, and to access the
internals of one you must 'bust-through' the hard outer layer to get at the
soft and chewy insides.

  Hope this helps.

  -- Dave Lovering

----- Original Message -----
From: "Chris Tifer" <christ at saeweb.com>
To: "[JavaScript List]" <javascript at LaTech.edu>
Sent: Friday, March 21, 2003 7:49 AM
Subject: Re: [Javascript] Enumerating Other Window


> You just have to target which window you want to look through by
> using the handler you used when opening the window.
>
> Chris Tifer
> http://www.emailajoke.com
>
> ----- Original Message -----
> From: <uplate at attbi.com>
> To: <Javascript at LaTech.edu>
> Sent: Friday, March 21, 2003 9:30 AM
> Subject: [Javascript] Enumerating Other Window
>
>
> > Greetings;
> >
> > using the window.open() method is it possible to open another URL and
then
> > enumerating through it's links or images arrays?
> > Opening the window is no problem and even using a for loop to retrieve
the
> links
> > on the current document is no probllem, but I can't seem to get the two
> working
> > together.
> > Any ideas?
> > Thanks.
> > _______________________________________________
> > Javascript mailing list
> > Javascript at LaTech.edu
> > https://lists.LaTech.edu/mailman/listinfo/javascript
>
> _______________________________________________
> Javascript mailing list
> Javascript at LaTech.edu
> https://lists.LaTech.edu/mailman/listinfo/javascript
>




More information about the Javascript mailing list