域之间的iFrame和父页面之间通信的可能方式 [英] Possible Ways to Communicate Between iFrame and Parent Page across domains
问题描述
请建议从iFrame触发父级页面中的事件的可能技术。我尝试了url哈希和使用window.postMessage技术,但没有任何成功。
Please suggest possible techniques to trigger events in parent page from an iFrame. I tried out url Hashing and using window.postMessage techniques but without any success.
推荐答案
easyXDM是为这个确切的目的设计的。
您可以在 http://easyxdm.net 上找到它,它有很多例子。
easyXDM is designed for this exact purpose. You can find it at http://easyxdm.net and it has quite a few examples.
总而言之,它允许两个窗口使用字符串或RPC调用自由地通信。
To sum it up, it allows two windows to communicate 'freely' using either strings or RPC calls.
请参阅 http:// consumer.easyxdm.net/current/example/methods.html 其中一个RPC演示。
See http://consumer.easyxdm.net/current/example/methods.html for one of the RPC-demos.
这篇关于域之间的iFrame和父页面之间通信的可能方式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!