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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help with Javascript Opening Windows

Status
Not open for further replies.

ds111

Technical User
Apr 7, 2008
1
US
I have a menu with 8 links. If i click on one of the links, it opens in a new page (target="_blank"). How do I prevent opening the same page multiple times? If you click a link "home" and the home page shows up and u click "home" in a different menu, it should do a focus on index.php (which is already opened) and just refresh the page.

Can i do this with javascript? Or is there another language i must write it in?
 
You don't need JavaScript - just do it with plain old HTML. If you give each "target" attribute a unique name, they should only ever open once:

Code:
<a href="/" target="WinHome">Home</a>
<a href="/page1" target="WinPage1">Page 1</a>
<a href="/page2" target="WinPage2">Page 2</a>
<a href="/about" target="WinAbout">About</a>
<a href="/contact" target="WinContact">Contact</a>

Hope this helps,
Dan



Coedit Limited - Delivering standards compliant, accessible web solutions

[tt]Dan's Page [blue]@[/blue] Code Couch
[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top