【发布时间】:2015-12-02 10:29:30
【问题描述】:
我有下面的 html 代码片段
<a href="http://www.google.co.in" target="_blank" >Google</a>
在 iframe 中。 单击 ipad chrome 中的 a 标签会在同一选项卡中打开。 根据标签参数,它应该在新标签/窗口中打开。
我错过了什么,请让我知道您对此的想法。 阻止它在 chrome 的新标签页中打开的任何原因
【问题讨论】:
我有下面的 html 代码片段
<a href="http://www.google.co.in" target="_blank" >Google</a>
在 iframe 中。 单击 ipad chrome 中的 a 标签会在同一选项卡中打开。 根据标签参数,它应该在新标签/窗口中打开。
我错过了什么,请让我知道您对此的想法。 阻止它在 chrome 的新标签页中打开的任何原因
【问题讨论】:
由于某些原因它不起作用,所以我们可以通过另一种方式做到这一点
只需删除该行并添加以下内容:-
<a onclick="window.open ('http://www.google.com', ''); return false" href="javascript:void(0);"></a>
【讨论】:
尝试使用_top 而不是_blank:
<a href="http://www.google.co.in" target="_top" >Google</a>
【讨论】: