【问题标题】:hyperlink onClick window.open超链接 onClick window.open
【发布时间】:2015-12-31 18:21:06
【问题描述】:

您好,我使用的超文本链接如下所示:

<a target="_blank" href="#" onClick="window.open('http://www.2n.cz/en/products/m2m/smartcom-pro/', '_blank')">basic information</a>

我在使用此脚本时遇到问题,浏览器总是为我打开 2 个新标签。一是我写的地址,二是我的网址。如何解决这个问题我想留在我的页面上,但想用地址打开一个新标签。非常感谢您的帮助! 使用 Chrome、Firefox。

【问题讨论】:

    标签: hyperlink onclick


    【解决方案1】:

    试试这个代码。

    &lt;a target="_blank" href="#" onclick="JavaScript: return !window.open('http://www.2n.cz/en/products/m2m/smartcom-pro/');"&gt;basic information&lt;/a&gt;

    【讨论】:

      猜你喜欢
      • 2018-11-22
      • 2016-09-24
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-08-20
      • 1970-01-01
      • 2011-12-24
      相关资源
      最近更新 更多