当您在弹出窗口中打开警报窗口时,弹出窗口消失

时间:2019-06-13 16:41:48

标签: javascript html internet-explorer-11

对于IE11。

如果您在A的弹出窗口中打开警报窗口,则该弹出窗口将消失一次,而当您再次进行检查时,将显示弹出窗口。

对于其他浏览器(Chrome,FF,Edge),警报显示在弹出窗口中。

我想知道是否有解决方案。

1 个答案:

答案 0 :(得分:0)

无法在我这一边重现问题。根据您的描述,我使用以下示例代码创建了一个示例,看来一切正常:

主页中的代码

<button onclick="myFunction()">Open new window</button>

<script>
    function myFunction() {
        window.open("popuppage.html","_blank","wight=900px, height=600px")
    }
</script>
popppage.html中的

代码:

<head>
    <meta charset="utf-8" />
    <title></title>
    <script>
        function myfunction() {
            alert("Hello");
        }
    </script>
</head>
<body>
    <a id="btnshowalert" href="#" onclick="return myfunction();" > show alert</a>

</body>

结果如下:

enter image description here

请尝试清除IE浏览器的缓存和历史记录,然后创建一个新页面来测试上述代码或重新测试您的代码。如果仍然无法使用,您可以尝试reset Internet Explorer settings并共享您的代码。