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
3 Answers
Reset to default 4No, 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
版权声明:本文标题:javascript - How to open a webpage in the same tab upon clicking a link in the mail - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744236662a2596587.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论