2015-10-15 83 views
0

如果我们尝试访问跨源数据,哪些版本的IE会引发异常?如果我在javascript代码调用 $('iframe[name="iframe"]').contents().find('body')iframe中的iframe跨源策略

IE不会抛出异常

然而,Chrome和Firefox做

DOMException: Failed to read the 'contentDocument' property from 'HTMLIFrameElement': Blocked a frame with origin "http://localhost:8080" from accessing a cross-origin frame.(…)

回答

0
这已经包括在内,因为IE7

你没有任何问题的原因是因为你已经在IE中设置了你的隐私设置来允许本地和跨域的通信。

有几种方法可以绕过这取决于你想要做什么。