【问题标题】:hyper link with target="_blank" does not open in new tab带有 target="_blank" 的超链接不会在新选项卡中打开
【发布时间】:2015-12-02 10:29:30
【问题描述】:

我有下面的 html 代码片段

<a href="http://www.google.co.in" target="_blank" >Google</a>

在 iframe 中。 单击 ipad chrome 中的 a 标签会在同一选项卡中打开。 根据标签参数,它应该在新标签/窗口中打开。

我错过了什么,请让我知道您对此的想法。 阻止它在 chrome 的新标签页中打开的任何原因

【问题讨论】:

标签: html hyperlink


【解决方案1】:

由于某些原因它不起作用,所以我们可以通过另一种方式做到这一点

只需删除该行并添加以下内容:-

<a onclick="window.open ('http://www.google.com', ''); return false" href="javascript:void(0);"></a>

【讨论】:

  • 请问是什么原因?它是 chrome 中的错误吗?
【解决方案2】:

尝试使用_top 而不是_blank

<a href="http://www.google.co.in" target="_top" >Google</a>

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-11-06
    • 2017-05-01
    • 2017-10-31
    • 2017-11-09
    • 2016-01-20
    相关资源
    最近更新 更多