【问题标题】:Uncaught DOMException: Blocked a frame with origin "http://localhost:8090" from accessing a cross-origin frame when I add Sensenet in iframe未捕获的 DOMException:当我在 iframe 中添加 Sensenet 时,阻止具有源“http://localhost:8090”的框架访问跨域框架
【发布时间】:2017-10-02 11:35:21
【问题描述】:

我正在尝试将 sensenet 的文档库添加到 iframe 中,当我将文件移动到另一个文件夹时,出现错误“未捕获的 DOMException:阻止具有源“http://localhost:8090”的框架访问跨域框架。 ”。我正在使用 chrome(版本 57.0.2987.133)。但是如果我使用 IE 11,它运行良好,你能给我一些建议来解决这个问题吗?

堆栈: 在 Object.RefreshExploreTree (http://localhost:8090/Root/Global/scripts/sn/SN.Util.js:354:38) 在 Object.success(评估在 (http://localhost:8090/Root/Global/scripts/jquery/jquery.js:3:4904), :22:25)

【问题讨论】:

标签: sensenet


【解决方案1】:

在某些情况下,使用时遇到的此错误是特定于浏览器的。如果您只满足于 GET 请求,那么使用 JSONP 的通常解决方案是一种替代方法。否则,您应该实施 CORS,这是 HTML5 中的首选解决方案。您可以从这里了解更多信息:

https://benohead.com/cross-document-communication-with-iframes/

sensenet ECM 还需要 CORS 的配置设置,但您可能已经知道:

http://wiki.sensenet.com/Cross-origin_resource_sharing

【讨论】:

    猜你喜欢
    • 2018-12-14
    • 2019-01-19
    • 2018-10-14
    • 2018-11-28
    • 1970-01-01
    • 2018-05-31
    • 2019-02-05
    • 2017-06-25
    • 2014-09-25
    相关资源
    最近更新 更多