[英]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.