admin管理员组

文章数量:1401193

I want to open a webpage in the same tab by clicking a link from email. So, If the webpage is already open in a tab, By clicking the link in email should not open another tab but should use the same tab to render the webpage.

For example - if .html is already open in a tab, By clicking .html link from email should not open another tab but should open the application in the same tab.

I understand, we can do this programatically using Javascript like window.open(".html","_self") but is there a way to form the URL to be used in email to open the webpage to acplish this?

Thanks

I want to open a webpage in the same tab by clicking a link from email. So, If the webpage is already open in a tab, By clicking the link in email should not open another tab but should use the same tab to render the webpage.

For example - if https://example./index.html is already open in a tab, By clicking https://example./index.html link from email should not open another tab but should open the application in the same tab.

I understand, we can do this programatically using Javascript like window.open("https://example./index.html","_self") but is there a way to form the URL to be used in email to open the webpage to acplish this?

Thanks

Share Improve this question asked Sep 8, 2017 at 14:54 GendafulGendaful 5,80213 gold badges59 silver badges78 bronze badges 3
  • 2 There is no way you can do that - and if you could do that, browser manufactorers would shut it down. Do not mess with the behaviour of the user. If the user wants to have your link in an already opened tab, he would open it there. – D B Commented Sep 8, 2017 at 14:57
  • 1 absolutelly, there´s no way, – bjesua Commented Sep 8, 2017 at 15:02
  • Got it. Had the same thoughts. Thanks for the suggestions. – Gendaful Commented Sep 8, 2017 at 15:17
Add a ment  | 

3 Answers 3

Reset to default 4

No, it is not technically possible. There are no ways to send this type of instructions from an email client to the browser. Moreover, javascript is not allowed in emails.

Use target="_self" in a page

<a href="https://example./index.html" target="_self">The Link</a>

From an email... not possible, because the email client has no idea in what tab the standard browser is

This is not possible for links in e-mails. Usually, the mail service provider is set to open it in a new tab so that the user is still connected.

本文标签: javascriptHow to open a webpage in the same tab upon clicking a link in the mailStack Overflow