Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Open links to the same window

Status
Not open for further replies.

royyan

Programmer
Jul 18, 2001
148
US
I have links openning up in seperate windows. Now, I want to open a new window only if we first click on one of links. Then, all the links open only in that window. Any good ideas? Thanks!
 
Instead of using a target of "_blank":

Code:
<a href="[URL unfurl="true"]http://www.google.co.uk/"[/URL] target="_blank">link</a>

use a unique name instead:

Code:
<a href="[URL unfurl="true"]http://www.google.co.uk/"[/URL] target="myNewWindow">link</a>

If the window named "myNewWindow" doesn't exist, it will be created. If it exists, the link will load in it.

Hope this helps,
Dan
 
Thanks, Dan. Your suggestion should work on most cases like this. But, my problem is, all my links are in PDF file and I have no way to make changes in those links. The good news is, all links are calling a same logging page and then redirected to the destination page. The logging page is written in ASP. I am thinking to add some codes on this page so it will only open window once. Do you have any idea how to do that?
Thanks a lot!
 

Why didn't you mention the PDF thing initially? It's kind of a big factor in the whole problem, don't you think (especially given that this is the HTML forum, not a PDF scripting forum!)...

I suggest you try the Adobe Acrobat forum: forum223 - they may be more able to assist.

I cannot think of any way off the top of my head regarding client-side code that would enable you to do what you wish as, by the time the client-side page is loaded, the window is already open... And you probably cannot query the opener as it's a PDF and probably doesn't support opener.

Dan


I guess you could check the opener.frames collection... or use JS to keep track of all window opened
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top