Javascript window.opener not working in IE 10

一曲冷凌霜 提交于 2019-12-11 13:18:53

问题


I've developed a plugin that open a pop up. Inside this pop up i have a link that clos my pop up and redirect the url of the parent, like this :

window.parent.opener.location = "http://google.fr"; 
or   
window.opener.location =     "http://google.fr";

Both are working but in some versions of IE, they don't. My parent page isn't on the same domain of my children page, but even when it is the case, it still doesn't work. IE puts a message at the bottom asking if I want to let the website do this. I'd like to know if there is a way to force IE to do it by default, without decreasing the security. Thanks.


回答1:


window.opener won't work in IE under default security level if the child window is from a different domain..

An option is to use location.href to redirect the child window to a page in the domain same as the parent window and then use window.opener



来源:https://stackoverflow.com/questions/16364576/javascript-window-opener-not-working-in-ie-10

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