繁体   English   中英

Window.在Opera中打开打开选项卡而不是弹出窗口?

[英]Window.open opening tab instead of popup in Opera?

我只是从 JavaScript 使用您可以在代码中看到的设置打开一个弹出窗口。 在 Firefox 中工作正常。 在 Opera 中,它改为在新选项卡中打开它。 为什么?

这是一个 JSFiddle: http://jsfiddle.net/hafWs/3/

参数的数量似乎没有什么区别。 在 Firefox 和 IE8 中工作。 (目前没有要测试的 IE9 或 Chrome。)

我试过谷歌搜索......找不到任何东西。 我什至没有在这里看到任何提及它的内容,但它显然在他们的示例中有效: http://www.quirksmode.org/js/popup.html

感谢您的任何帮助。

这由浏览器本身(首选项)控制,不能从 JavaScript 更改。

NOTE: I've seen some posts that say you can determine whether the window opens in a tab or as a new window based on the parameters that you pass the window.open function. 我从来没有一直看到这项工作。

选项参数中的空格有问题:

window.showPopup = function(){
    window.open(
        'http://placekitten.com/600/500',
        'thePopup',
        'width=600,height=500' /* <------- Look, no spaces and works */
    );
}

它仍然是一个标签,但具有不同的尺寸。 所以,它看起来有点像弹出窗口。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM