我的工作遇到了一些问题。
这是我的代码。
父窗口
child = window.open(url, "pop", "width=790,height=890,scrollbars=yes"); $("#module").attr("action", "https://~~~").attr("async", false).attr("method", "GET").attr("target", "pop").attr("acceptCharset", "UTF-8").submit().focus();
子窗口
$(opener.location).attr("href", "javascript:functionName();"); open(location, "_self").close();
这些代码在所有浏览器和操作系统中都没有错误。
一台特定笔记本电脑出现问题。
问题是“缺少开启器”。
此错误在特定笔记本电脑上的 IE11、Windows10 上运行。
它在同一台笔记本电脑的另一个浏览器上运行良好。
最佳答案
您的 IE 很可能在保护模式下运行。这是一个已知问题/功能:https://social.msdn.microsoft.com/Forums/ie/en-US/5d9efaa1-78d5-45dc-a04d-d9fde768379f/ie-11-windowopener-in-popup-dialog .
"The window.opener property is nulled in a particular scenario when Protected Mode / UAC are enabled for the content in question."
尝试将其关闭并查看问题是否仍然存在。
关于javascript - 在 IE11 中使用 window.opener,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48292498/