简体   繁体   English

Javascript window.opener在IE 10中不起作用

[英]Javascript window.opener not working in IE 10

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. 两者都可以工作,但是在IE的某些版本中却不能。 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. IE在底部显示一条消息,询问是否要让网站执行此操作。 I'd like to know if there is a way to force IE to do it by default, without decreasing the security. 我想知道是否有一种方法可以强制IE在不降低安全性的情况下默认执行该操作。 Thanks. 谢谢。

window.opener won't work in IE under default security level if the child window is from a different domain.. 如果子窗口来自其他域,则window.opener在默认安全级别下无法在IE中工作。

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 一个选项是使用location.href将子窗口重定向到与父窗口相同的域中的页面,然后使用window.opener

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM