阅读背景:

JS报错:Permission denied to access property 'document'---document.domain - JavaScript的同源策略问题

来源:互联网 

错误原因是因为父窗口与子窗口的域名不同,即便同一站点下,也需要写全引用地址:如同是xxx.com下的页面<iframe id="iframe_xxxx" name="iframe_xxxx" src ="/sub.html" frameborder="0" height="300" width="1000"></iframe>与<iframe id="iframe_xxxx" name="iframe_xxxx" src ="https://www.xxx.com/sub.html" frameborder="0" height="300" width="1000"></iframe>是有区别的:如同是xxx.co




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: