How do I change current Tab, while opening new Tab too?

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
simonmlewis
DevNet Master
Posts: 4435
Joined: Wed Oct 08, 2008 3:39 pm
Location: United Kingdom
Contact:

How do I change current Tab, while opening new Tab too?

Post by simonmlewis »

We need to make a hyperlink open a new Tab (so they don't lose their way), but we also want the previous tab to change.

So let's say they click a link to open a "library" page. We want our page to move to "thanks for visiting our library".

How do we do that? I'm guessing in Javascript. It won't need to be dynamic.
Love PHP. Love CSS. Love learning new tricks too.
All the best from the United Kingdom.
simonmlewis
DevNet Master
Posts: 4435
Joined: Wed Oct 08, 2008 3:39 pm
Location: United Kingdom
Contact:

Re: How do I change current Tab, while opening new Tab too?

Post by simonmlewis »

<a
href="http://www.google.com"
target="_blank"
onclick="document.location.href='http://www.site.com'"
>Click here to open site in this window</a>
Bingo. Unless there is a better way?
Love PHP. Love CSS. Love learning new tricks too.
All the best from the United Kingdom.
Post Reply