2015-10-15 82 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中設置了你的隱私設置來允許本地和跨域的通信。

有幾種方法可以繞過這取決於你想要做什麼。