首页 > 解决方案 > window.open 在边缘浏览器中返回 null 作为子窗口引用

问题描述

这是我在应用程序的 JS 文件中编写的代码的一部分:

var myUrl="https://www.google.com";
var myArr=[];
var childWin= window.open(myUrl,'_blank');
myArr.push({chidlWindowHandle:childWin});
console.log(myArr.chidlWindowHandle);

它在 chrome 和 firefox 中打印子窗口对象。但它在边缘浏览器中返回 null。

谁能告诉我如何在 Edge 中获取子窗口引用?

谢谢!

标签: javascriptjqueryhtmlcross-browser

解决方案


推荐阅读