Page 1 of 1

[SOLVED ]Redirecting parent window from child window

Posted: Thu Jul 08, 2004 5:35 am
by Jean-Yves
Hi there,

A question for the client-side gurus. I have a feeling that the answer is straightforward, but I have not been able to find what I want yet via google.

My online game has an allies button which opens a small child window that lists the characters under the current player's control. What I would like to do is click on one of these and have the underlying parent window switch to that character's view.

In other words, get the parent window to redirect to another php script by clicking on a button on the child window. Ideally the child window would still be able to communicate with the parent, so subsequent clicks on other characters would work.

Any help, as ever, is much appreciated.

Posted: Thu Jul 08, 2004 5:57 am
by JayBird
just use

Code: Select all

target="_parent"
in you href

Mark

Posted: Thu Jul 08, 2004 6:12 am
by jollyjumper
in javascript window.opener from your child window refers to the parent where you have opened your window from

Posted: Thu Jul 08, 2004 6:57 am
by Jean-Yves
Many thanks. I could not get the _parent method to work, but using opener.document.location="newurl" works prefectly.

Thanks to both of you :)

Posted: Thu Jul 08, 2004 7:03 am
by jollyjumper
your welcome