Open links from two websites in the same tab
up vote
1
down vote
favorite
I would like to leverage the ability to control in which tab/window a link opens by the target attribute. It works nice, when I have website with multiple links with the same target attribute they all open in one tab/window. However if I have links on two separate websites (each on a different subdomain) it doesn't work.
I would like to have a website on eg www.subA.goout.net with a link<a href="https://www.google.com" target="my_window">...</a>
and a website on www.subB.goout.net with eg.<a href="https://www.zadnyspe.ch" target="my_window">...</a>
How would one achieve for these two links to open in the same tab/window? And what exactly are the requirements for the target attribute to take an effect?
html
|
show 1 more comment
up vote
1
down vote
favorite
I would like to leverage the ability to control in which tab/window a link opens by the target attribute. It works nice, when I have website with multiple links with the same target attribute they all open in one tab/window. However if I have links on two separate websites (each on a different subdomain) it doesn't work.
I would like to have a website on eg www.subA.goout.net with a link<a href="https://www.google.com" target="my_window">...</a>
and a website on www.subB.goout.net with eg.<a href="https://www.zadnyspe.ch" target="my_window">...</a>
How would one achieve for these two links to open in the same tab/window? And what exactly are the requirements for the target attribute to take an effect?
html
You're doing it right. JSFiddle example
– Jean-Marc Zimmer
Nov 7 at 16:28
1
@Jean-MarcZimmer "However if I have links on two separate websites (each on a different subdomain) it doesn't work." - So I don't think this is the same case, maybe some security restrictions but I'm not sure
– Alon Eitan
Nov 7 at 16:32
Oh, whoops, I didn't get that. I think we can do that with Javascript however (withwindow.open)
– Jean-Marc Zimmer
Nov 7 at 16:36
@Jean-MarcZimmer Sorry the question isn't very well formulated. However it doesn't work with JS neither. It looks like not only thetargetmust be the same, but also page which the link is part of. And that's the most interesting part of this question. What exactly is needed for two links to open in the same tab?
– Jen
Nov 7 at 16:52
Maybe -I couldn't find reliable information about that- this is a security thing : Imagine if two websites (which don't have anything to do one to the other) opened their external links in the same tab ? That would be a nightmare. And I'm sure you're not the first one asking yourself if it's possible. Actually, if we could, when you get the "confirm your email adress" link in the mail, we'd get it opened in the tab where it says "check your emails".
– Jean-Marc Zimmer
Nov 7 at 17:02
|
show 1 more comment
up vote
1
down vote
favorite
up vote
1
down vote
favorite
I would like to leverage the ability to control in which tab/window a link opens by the target attribute. It works nice, when I have website with multiple links with the same target attribute they all open in one tab/window. However if I have links on two separate websites (each on a different subdomain) it doesn't work.
I would like to have a website on eg www.subA.goout.net with a link<a href="https://www.google.com" target="my_window">...</a>
and a website on www.subB.goout.net with eg.<a href="https://www.zadnyspe.ch" target="my_window">...</a>
How would one achieve for these two links to open in the same tab/window? And what exactly are the requirements for the target attribute to take an effect?
html
I would like to leverage the ability to control in which tab/window a link opens by the target attribute. It works nice, when I have website with multiple links with the same target attribute they all open in one tab/window. However if I have links on two separate websites (each on a different subdomain) it doesn't work.
I would like to have a website on eg www.subA.goout.net with a link<a href="https://www.google.com" target="my_window">...</a>
and a website on www.subB.goout.net with eg.<a href="https://www.zadnyspe.ch" target="my_window">...</a>
How would one achieve for these two links to open in the same tab/window? And what exactly are the requirements for the target attribute to take an effect?
html
html
asked Nov 7 at 16:23
Jen
996
996
You're doing it right. JSFiddle example
– Jean-Marc Zimmer
Nov 7 at 16:28
1
@Jean-MarcZimmer "However if I have links on two separate websites (each on a different subdomain) it doesn't work." - So I don't think this is the same case, maybe some security restrictions but I'm not sure
– Alon Eitan
Nov 7 at 16:32
Oh, whoops, I didn't get that. I think we can do that with Javascript however (withwindow.open)
– Jean-Marc Zimmer
Nov 7 at 16:36
@Jean-MarcZimmer Sorry the question isn't very well formulated. However it doesn't work with JS neither. It looks like not only thetargetmust be the same, but also page which the link is part of. And that's the most interesting part of this question. What exactly is needed for two links to open in the same tab?
– Jen
Nov 7 at 16:52
Maybe -I couldn't find reliable information about that- this is a security thing : Imagine if two websites (which don't have anything to do one to the other) opened their external links in the same tab ? That would be a nightmare. And I'm sure you're not the first one asking yourself if it's possible. Actually, if we could, when you get the "confirm your email adress" link in the mail, we'd get it opened in the tab where it says "check your emails".
– Jean-Marc Zimmer
Nov 7 at 17:02
|
show 1 more comment
You're doing it right. JSFiddle example
– Jean-Marc Zimmer
Nov 7 at 16:28
1
@Jean-MarcZimmer "However if I have links on two separate websites (each on a different subdomain) it doesn't work." - So I don't think this is the same case, maybe some security restrictions but I'm not sure
– Alon Eitan
Nov 7 at 16:32
Oh, whoops, I didn't get that. I think we can do that with Javascript however (withwindow.open)
– Jean-Marc Zimmer
Nov 7 at 16:36
@Jean-MarcZimmer Sorry the question isn't very well formulated. However it doesn't work with JS neither. It looks like not only thetargetmust be the same, but also page which the link is part of. And that's the most interesting part of this question. What exactly is needed for two links to open in the same tab?
– Jen
Nov 7 at 16:52
Maybe -I couldn't find reliable information about that- this is a security thing : Imagine if two websites (which don't have anything to do one to the other) opened their external links in the same tab ? That would be a nightmare. And I'm sure you're not the first one asking yourself if it's possible. Actually, if we could, when you get the "confirm your email adress" link in the mail, we'd get it opened in the tab where it says "check your emails".
– Jean-Marc Zimmer
Nov 7 at 17:02
You're doing it right. JSFiddle example
– Jean-Marc Zimmer
Nov 7 at 16:28
You're doing it right. JSFiddle example
– Jean-Marc Zimmer
Nov 7 at 16:28
1
1
@Jean-MarcZimmer "However if I have links on two separate websites (each on a different subdomain) it doesn't work." - So I don't think this is the same case, maybe some security restrictions but I'm not sure
– Alon Eitan
Nov 7 at 16:32
@Jean-MarcZimmer "However if I have links on two separate websites (each on a different subdomain) it doesn't work." - So I don't think this is the same case, maybe some security restrictions but I'm not sure
– Alon Eitan
Nov 7 at 16:32
Oh, whoops, I didn't get that. I think we can do that with Javascript however (with
window.open)– Jean-Marc Zimmer
Nov 7 at 16:36
Oh, whoops, I didn't get that. I think we can do that with Javascript however (with
window.open)– Jean-Marc Zimmer
Nov 7 at 16:36
@Jean-MarcZimmer Sorry the question isn't very well formulated. However it doesn't work with JS neither. It looks like not only the
target must be the same, but also page which the link is part of. And that's the most interesting part of this question. What exactly is needed for two links to open in the same tab?– Jen
Nov 7 at 16:52
@Jean-MarcZimmer Sorry the question isn't very well formulated. However it doesn't work with JS neither. It looks like not only the
target must be the same, but also page which the link is part of. And that's the most interesting part of this question. What exactly is needed for two links to open in the same tab?– Jen
Nov 7 at 16:52
Maybe -I couldn't find reliable information about that- this is a security thing : Imagine if two websites (which don't have anything to do one to the other) opened their external links in the same tab ? That would be a nightmare. And I'm sure you're not the first one asking yourself if it's possible. Actually, if we could, when you get the "confirm your email adress" link in the mail, we'd get it opened in the tab where it says "check your emails".
– Jean-Marc Zimmer
Nov 7 at 17:02
Maybe -I couldn't find reliable information about that- this is a security thing : Imagine if two websites (which don't have anything to do one to the other) opened their external links in the same tab ? That would be a nightmare. And I'm sure you're not the first one asking yourself if it's possible. Actually, if we could, when you get the "confirm your email adress" link in the mail, we'd get it opened in the tab where it says "check your emails".
– Jean-Marc Zimmer
Nov 7 at 17:02
|
show 1 more comment
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53193637%2fopen-links-from-two-websites-in-the-same-tab%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
You're doing it right. JSFiddle example
– Jean-Marc Zimmer
Nov 7 at 16:28
1
@Jean-MarcZimmer "However if I have links on two separate websites (each on a different subdomain) it doesn't work." - So I don't think this is the same case, maybe some security restrictions but I'm not sure
– Alon Eitan
Nov 7 at 16:32
Oh, whoops, I didn't get that. I think we can do that with Javascript however (with
window.open)– Jean-Marc Zimmer
Nov 7 at 16:36
@Jean-MarcZimmer Sorry the question isn't very well formulated. However it doesn't work with JS neither. It looks like not only the
targetmust be the same, but also page which the link is part of. And that's the most interesting part of this question. What exactly is needed for two links to open in the same tab?– Jen
Nov 7 at 16:52
Maybe -I couldn't find reliable information about that- this is a security thing : Imagine if two websites (which don't have anything to do one to the other) opened their external links in the same tab ? That would be a nightmare. And I'm sure you're not the first one asking yourself if it's possible. Actually, if we could, when you get the "confirm your email adress" link in the mail, we'd get it opened in the tab where it says "check your emails".
– Jean-Marc Zimmer
Nov 7 at 17:02