Forum Moderators: open

Message Too Old, No Replies

Open new page in existing window

         

Frank_Rizzo

10:46 am on May 6, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



How can I use a href link to open a page on an existing window?

1. User starts IE and visits widgets.com/green_info.html (call this window1)

2. In a seperate browser window (window2) the user visits widgetsguide.com. On this page is a link to widgets.com/blue_info.html

What I want to happen is for this link to change the page of window1

If I have <a href="..widgets.com/blue_info.html">blue widgets</a> that will open up the page in that window (window2)

If I have target="_blank" it will open up a new window

How can I set this so that the page in window1 is changed instead?

milanmk

12:25 pm on May 6, 2006 (gmt 0)

10+ Year Member



That is only possible if window2 is being opened by window1 i.e. only child and parent windows have this handler.

Milan

tedster

7:11 pm on May 6, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You need to use javascript window.open() to open the new windows, rather than using target="_blank". By using this approach, you can assign each window that opens a name - it's the second possible parameter in the window.open() method.

By creating the new windows with an assigned name, links in window2 can use target="window1" (or whatever name yu gave that window) as an attribute. If by any chance the user has already closed window1, then a click on the link will recreate it.