[英]how to prevent javascript blocking of open new tab with ctrl+click
In chrome standart behavour for ctrl+click is open link in new tab. 在chrome标准操作中,ctrl +单击是新标签中的打开链接。
But inline js <a href="..." onclick="<some js>">
hinders to open in new tab with ctrl+click. 但是内联js
<a href="..." onclick="<some js>">
妨碍您使用ctrl + click在新标签页中打开。 It just opens link in same tab. 它只是在同一选项卡中打开链接。
What is easiest way to provide a normal behavior by ctrl+click for this case? 在这种情况下,通过ctrl + click提供正常行为的最简单方法是什么?
If you can be a little more specific on what you want to do exactly, I might be able to help you more. 如果您可以更精确地确定自己想做的事情,我可能会为您提供更多帮助。
I am not quite sure on what your asking. 我不太确定你的要求。 But to use onclick to open a new tab.
但是要使用onclick打开一个新选项卡。 You can use the example below.
您可以使用下面的示例。
function tab(url) { var win = window.open(url, '_blank'); win.focus(); }
<a onclick="tab('http://www.google.com');">New Tab</a>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.