showModalDialog; Opens a New Window in IE

守給你的承諾、 提交于 2019-12-04 08:09:27

Your issue arises because you are using showModalDialog which introduces this behavior when using IE.

You can read about it here:

showModalDialog Opens a New Window

If you want to continue using showModalDialog here is a work around:

modal.html

<head>
    <base target="_self" />
    ...
</head>
<body style="margin:0px">     
        ....
        <a href="anotherpage.html" id="go" style="display:none;"></a>
    </form>
</body>

frame.html

function redirectToCart() {
    window.parent.document.getElementById('go').click(); 
}

Example

http://plnkr.co/edit/ClxlWqkzBmTy93kJzuru?p=preview

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!