【问题标题】:how to open a link in new window using html? [duplicate]如何使用html在新窗口中打开链接? [复制]
【发布时间】:2013-09-27 11:47:08
【问题描述】:

我想在新窗口而不是新标签中打开链接。我在目标中使用了“_blank”和“_new”,但它不起作用,它在新窗口中打开。

<a href="allskills.php" style="text-decoration:none" target="_new">All Skills</a>
or
<a href="#" style="text-decoration:none" onClick="window.open('allskills.php', '_blank')">All Skills</a>

有什么方法可以在新窗口中打开吗?

谢谢

【问题讨论】:

  • 正确阅读问题..
  • @Quentin 看到了这个问题,但它不起作用。
  • @SidM 看到了这个问题,但它不起作用
  • @smAnkurDhanuka — 当重复问题的公认答案是“你不能那样做”时,你为什么希望它能够工作?
  • @Quentin 它不起作用..这就是我问问题的原因,我已经提到“_blank”或“_new”不起作用

标签: html


【解决方案1】:

DEMO FIDDLE

试试这个

popupWin = window.open('http://webdesign.about.com/',
'open_window',
'menubar, toolbar, location, directories, status, scrollbars, resizable,
dependent, width=640, height=480, left=0, top=0')

【讨论】:

    【解决方案2】:

    FF 使用制表符。您只能使用 Javascript 打开的新窗口: window.open('example.html', 'name', 'settings')

    http://www.w3schools.com/js/tryit.asp?filename=try_win_focus

    【讨论】:

      猜你喜欢
      • 2021-02-26
      • 1970-01-01
      • 2013-11-03
      • 2017-11-25
      • 2014-10-07
      • 1970-01-01
      • 1970-01-01
      • 2011-07-07
      • 2020-12-01
      相关资源
      最近更新 更多