PDA

View Full Version : question about the target="_blank" command



code beginner
Oct 15th, 2009, 12:22 AM
Hello,

If you use the target="_blank" command in an <a href> link, clicking on it will open up a second internet explorer (IE) window. If you do this 10 times, you will have 10 different internet explorers opened up.

Is there a way to have open up a second internet explorer window, where every external link goes to that one window?

For example: the main page is called www.pizza.com
you always want that IE to stay active and not dissapear on a link click.

the secondary pages will be for soda pages. those always go to the second IE window, and replace whatever was in that before.

so it would work like this:

the visitor goes to www.pizza.com, that page stays open

on the www.pizza.com site, they click on www.pepsi.com. the www.pizza.com stays open, and launches the pepsi site in a new IE window or tab.

on the www.pizza.com site, the user then clicks on www.sprite.com. the www.pizza.com IE still stays open, but the www.sprite.com page kicks out the www.pepsi.com page in the second window.

on the www.pizza.com site, the user then clicks on www.coca-cola.com. the www.pizza.com IE still stays open, but the www.coca-cola.com page kicks out the www.sprite.com page in the second window.

do you see what I'm getting at? I'm looking to have two windows. The first one is the main site, which you never want to close. The second IE window always houses the most recent external link that was clicked on.

I know how to create a one-window situation using the target = "self" command, and an infinite number of windows using the target="_blank" command. what I'm looking to do is create an exactly two-window situation once the visitor clicks on an external link.

I think there is a way to do this using the target command, but I don't know how. Any ideas?

SB65
Oct 15th, 2009, 09:19 AM
Just give the target attribute a name: target="soda" or whatever, then the first time clicked will open a new window/tab, and subsequent clicks will refresh the same window.