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?










share|improve this question






















  • 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 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















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?










share|improve this question






















  • 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 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













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?










share|improve this question













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






share|improve this question













share|improve this question











share|improve this question




share|improve this question










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 (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










  • 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






  • 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 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
















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

















active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














 

draft saved


draft discarded


















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






























active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes
















 

draft saved


draft discarded



















































 


draft saved


draft discarded














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





















































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







這個網誌中的熱門文章

Academy of Television Arts & Sciences

L'Équipe

1995 France bombings