一组多个 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 中实现此功能的方法吗?
最佳答案
我在尝试弹出两个独立窗口时遇到了同样的问题。第二个窗口将替换第一个窗口的链接。我发现答案是给 window 不同的名字。示例:“test1”和“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>
关于javascript - 多个 javascript window.open 调用在 chrome 和 IE11 中失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25731687/