document.domain文档跨域

在https://id.qq.com/使用w=window.open('http://www.qq.com’)之后会返回一个http://www.qq.com页面的window对象w

但是在https://id.qq.com/页面无法访问w.document

 

解决方法就是 设置当前页面window.document.domain = ‘qq.com’

 

w.document就不会报跨域的错

原文地址:https://www.cnblogs.com/lhs-fight/p/15121359.html