简体   繁体   English

强制页面在每次按钮单击时打开一个新选项卡,而不是覆盖

[英]Force page to open a new tab on each button click instead of overwriting

We have a site we're working on that is somewhat of a research source.我们有一个我们正在开发的网站,它在某种程度上是一个研究来源。 We have an embedded Tableau dashboard with buttons on the main page that each lead to a different page with the same base url but different query parameters.我们有一个嵌入式 Tableau 仪表板,主页上有按钮,每个按钮都指向不同的页面,该页面具有相同的基本 url 但查询参数不同。 For example:例如:

What we would like is for a new tab to open on each click so the user can come back to that resource later.我们希望在每次点击时打开一个新选项卡,以便用户稍后可以返回该资源。 Currently, the first button click does open a new tab but each subsequent click overwrites the tab that was opened with the first click.目前,第一次按钮单击确实会打开一个新选项卡,但每次后续单击都会覆盖第一次单击打开的选项卡。 Is there an HTML or Javascript way of solving this problem?是否有解决此问题的 HTML 或 Javascript 方法? Since the buttons are within the embedded Tableau dashboard, they don't have access to a right click by the user.由于这些按钮位于嵌入式 Tableau 仪表板中,因此它们无权访问用户的右键单击。

You can add the target="_blank" attribute to the link:您可以将 target="_blank" 属性添加到链接:

<a href="wherever" target="_blank">Link</a>

And you can just put the button in the link so whenever someone clicks on the button it will open a new tab.你可以把按钮放在链接中,这样每当有人点击按钮时,它就会打开一个新标签。

<a href="wherever" target="_blank">
    <button>Link</button>
</a>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 单击按钮在浏览器的新选项卡中打开 sapui5 详细信息页面 - open sapui5 detail page in a new tab of the browser on click of a button 如何在vueJs中不点击按钮的情况下在新标签页中打开页面 - How to open page in new Tab without button click in vueJs Chrome扩展程序:打开新标签页,然后点击按钮 - Chrome extension: Open new tab and click on button 单击按钮,在新选项卡上打开链接 - Open link on a new tab on click of button 在 AngularJS 中单击按钮打开一个新选项卡 - Open a new tab on button click in AngularJS window.open在新标签页而不是弹出窗口中打开页面 - window.open open the page in a new tab instead of in popup window emberjs所需的页面不会在“右键单击在新选项卡中打开”上打开 - emberjs desired page wont open on “right click open in new tab” 角度选项卡选择打开新页面而不是在同一页面中打开 - angular tab selection opens new page instead of open in the same page 如何在 vue 3 中单击按钮打开一个新页面? - How to open a new page on button click in vue 3? 如何在ASP C#上打开新标签页,然后将焦点集中在当前页面上,然后单击按钮将当前页面重定向到另一个页面? - How to open new tab on ASP C# and focus stay on current page then current page redirect to another page on click button?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM