【问题标题】:Open link in new window , not in new tab [duplicate]在新窗口中打开链接,而不是在新标签中[重复]
【发布时间】:2014-05-13 07:06:12
【问题描述】:
我正在尝试在新窗口中打开一个链接,尝试了一些代码,但它们显示在新标签中。有什么建议请...
<a href="https://www.google.co.in/" target="_blank" >Demo</a> // this opens in new tab
<li onclick="window.open('https://www.google.co.in/')">Demo</li> // this is also opening in new tab
提前致谢
【问题讨论】:
标签:
javascript
php
html
hyperlink
href
【解决方案1】:
试试看
<li onclick="window.open('http://www.google.com','mywindow','height:400;width:400;')">Demo</li>
【解决方案2】:
试试这个:
<li onclick="window.open('http://publichealth.ecareagora.com','mywindow','height:auto;width:auto;')">Demo</li>
【解决方案3】:
使用下面的代码希望它能解决你的问题
Java 脚本
function MM_openBrWindow(theURL,winName,features)
{
window.open(theURL,winName,features);
return false;
}
在html按钮中
onclick="MM_openBrWindow('help1.php','','width=750, height=650,left =530,
top =230, location=no, menubar=no, status=yes,toolbar=yes,
scrollbars=yes, resizable=yes')