chrome和IE11中的多个javascript window.open调用失败

multiple javascript window.open calls fail in chrome and IE11

本文关键字:window javascript open 调用 失败 IE11 chrome      更新时间:2023-09-26

一组多个window.open()调用,如中所述http://www.w3schools.com/jsref/tryit.asp?filename=tryjsref_win_open6例如

    w1=window.open("http://www.google.com/");
    w2=window.open("http://www.w3schools.com/");

在FireFox中可以正常工作,但在Chrome 36和IE 11中只打开了一个新选项卡。

任何人都知道如何在Chrome中实现这一点;IE?

我在尝试弹出两个独立窗口时遇到了同样的问题。第二个窗口将替换第一个窗口的链接。我发现答案是给窗户起不同的名字。示例:"test1"answers"test2"

<html>
<head>
<script type="text/javascript">
window.open("http://www.google.com", "test1",  "resizable=no,scrollbars=yes,width=260,height=225");
window.open("http://www.google.com", "test2", "resizable=no,scrollbars=yes,width=260,height=225");
</script>
</head>
</html>