[SOLVED ]Redirecting parent window from child window

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
User avatar
Jean-Yves
Forum Contributor
Posts: 148
Joined: Wed Jul 02, 2003 2:13 pm
Location: West Country, UK

[SOLVED ]Redirecting parent window from child window

Post 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.
Last edited by Jean-Yves on Thu Jul 08, 2004 6:58 am, edited 1 time in total.
User avatar
JayBird
Admin
Posts: 4524
Joined: Wed Aug 13, 2003 7:02 am
Location: York, UK
Contact:

Post by JayBird »

just use

Code: Select all

target="_parent"
in you href

Mark
jollyjumper
Forum Contributor
Posts: 107
Joined: Sat Jan 25, 2003 11:03 am

Post by jollyjumper »

in javascript window.opener from your child window refers to the parent where you have opened your window from
User avatar
Jean-Yves
Forum Contributor
Posts: 148
Joined: Wed Jul 02, 2003 2:13 pm
Location: West Country, UK

Post 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 :)
jollyjumper
Forum Contributor
Posts: 107
Joined: Sat Jan 25, 2003 11:03 am

Post by jollyjumper »

your welcome
Post Reply