在ie中frame(iframe)标签通过name和id获取的对象是不同的。

通过name获取的本身就是contentWindow对象。
所以 在ie中不用再找contentWindow了

例:

let commitObj = window.frames["child_iframe_rel"];
let targetOrigin = "*";
//传参
let input_params = {...};
					    
//判断是否是IE下的
if(this.isIE) {
    commitObj.postMessage(input_params, targetOrigin);
} else {	//非IE下
    commitObj.contentWindow.postMessage(input_params, targetOrigin);
}    

  

相关文章:

  • 2021-10-13
  • 2022-02-02
  • 2022-02-22
  • 2021-12-08
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-14
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-08-26
  • 2021-09-08
相关资源
相似解决方案