[thelist] Child Window

Mark Kennedy mark at eurogamer.net
Wed Mar 12 06:06:15 CST 2003


Hi there,

Opening a child window using

window.open()

returns a window object handle for your child window.  Using this you can
manipulate the documents in your child windows.

So, assuming you've opened your two child windows using window.open(), you can
do something like this.

in parent:

wObj1 = window.open( "child1.html", "child1" );
wOjb2 = window.open( "child2.html", "child2" );

function refresh() {
	wObj2.location = new_child2_location;
	window.location = new_parent_location;
}

then in child1.html

window.opener.refresh();

Although I haven't actually tried this out.  The only thing is that you've now
lost the two handles to the child windows.  You might be able to make the first
child window 'steal' window handles from the parent like this:

in child1.html

daddyObj = window.opener;
wObj2 = window.opener.wObj2;

At which point you can now manipulate the both windows using these handles.

I hope this works for you as I haven't run this code to test it.  But I think
the general idea is sound enough.

Regards,

Mark


>Here is the question:
><><<><><><><><><><<><<><><><><><><><<><<><><><><><><><
>
>I have a parent window which i use to open two child windows.
>
>I use one child window to do an update which at the
>end refreshes the parent window.
>
>But i not only want to refresh the parent window with this child window
>but i also want to refresh the other open child window.
>
>How can i achieve this?
>
><><<><><><><><><><<><<><><><><><><><<><<><><><><><><><










More information about the thelist mailing list