IE11 window.open不会在现有选项卡中加载页面

时间:2015-08-14 08:42:36

标签: tabs internet-explorer-11 window.open

我有一个页面在IE11中打开第二个选项卡,然后在第二个选项卡中我希望能够单击一个按钮并使其导致第一个选项卡加载不同的页面。我提供了一个在Chrome中正常运行的简单示例,但在IE11中没有。

在下面的代码中,我明确地将第一个标签的window.name设置为PascalPage,即使我在page2.html的window.open调用中引用此名称,它也会在page2.html标签中加载Google页面page1.html标签页

第1.html页

<html>
<head>
    <title>Page1</title>

    <script>
        this.window.name="PascalPage";
        function doStuff() {
            window.open("page2.html", "_blank");
        }
    </script>
<head>
<body>
    <button onclick="javascript:doStuff();" value="button">Button</button>
</body>
</html>

Page2.html

<html>
<head>
    <title>Page2</title>

    <script>
        function doStuff() {
            window.open("http://www.google.com", "PascalPage");
        }
    </script>
<head>
<body>
    <button onclick="javascript:doStuff();" value="button">Button</button>
</body>

在我的“Internet设置”选项中,所选选项是允许IE决定如何处理选项卡。

有人可以帮忙吗?

0 个答案:

没有答案
相关问题