我通过 window.open 方法打开了一个新窗口,在该窗口的内容中我有一个带有“target=_blank”的链接。
当单击该链接时,该链接会在父窗口中打开新选项卡,而不是内容所在的选项卡。我还注意到,对于该窗口(使用 window.open 创建),Ctrl+T 快捷键(用于打开空白选项卡,Firefox)确实如此不行。
我检查了 window.open 规范,但没有找到任何允许此行为的选项。
var a = window.open("http://www.google.pl",
"Test",
"width=640,height=480,scrollbars=yes,toolbar=yes,menubar=no,location=no,resizable=yes");
a.focus();
设置toolbar=yes 使其在Firefox 中工作。知道如何让它在 Chrome 中工作吗?
最佳答案
你能展示一些代码吗?
其他;尝试使用 JavaScript:
函数 OpenNew(){
window.open("http://www.google.se", "_blank");
}
Rgd
关于javascript - 在浏览器窗口中打开新选项卡(使用 window.open 打开),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31117525/