我可以点击新浏览器(不弹出窗口)窗口打开链接吗?
我尝试过的事情:
<a href='http://osric.net/' onclick='return !window.open(this.href);'>osric.net web hosting</a>
功能onclick:
var windowObjectReference;
var strWindowFeatures = "menubar=yes,location=yes,resizable=yes,scrollbars=yes,status=yes, toolbar=yes";
function openRequestedPopup() {
windowObjectReference = window.open("http://www.cnn.com/", "CNN_WindowName", strWindowFeatures);
}
但有了这些,它只会在新标签页中打开。
答案 0 :(得分:0)
这适用于IE 11:
<script>
function popupBrowser(url) {
window.open(url, "WindowName", "config=menubar=no,location=yes,resizable=yes,scrollbars=yes,status=yes,toolbar=yes,fullscreen=yes");
}
</script>
<a href="javascript:popupBrowser('http://www.cnn.com')">Open a new browser for IE11</a>
它只是使用windows.open()
答案 1 :(得分:-1)
这就是
<a href="your_link" target="_blank">Visit</a>
target =“_ blank” - 是关键
将此用于新窗口
<a href="print.html" onclick="window.open('print.html', 'newwindow', 'width=300, height=250'); return false;"> Print</a>