admin管理员组文章数量:1267930
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.
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.
Share Improve this question edited May 2, 2011 at 6:01 Gabe 86.8k12 gold badges143 silver badges238 bronze badges asked May 5, 2010 at 7:51 SKRSKR 8134 gold badges20 silver badges33 bronze badges4 Answers
Reset to default 3easyXDM is designed for this exact purpose. You can find it at http://easyxdm and it has quite a few examples.
To sum it up, it allows two windows to municate 'freely' using either strings or RPC calls.
See http://consumer.easyxdm/current/example/methods.html for one of the RPC-demos.
No success because you cannot for security reasons.
The modern answer to this question is the new cross-document messaging (Web Messaging API)
See Opera's introduction here:
http://dev.opera./articles/view/window-postmessage-messagechannel/
Or the specification here: http://www.w3/TR/webmessaging/
The only idea that es to mind is to have a script on server side that the iFrame sends its events to (bined with a unique ID) and that the parent page can poll (either through a server script on its domain, or JSONP). That's a lot of work to do, though, and requires cooperation from both the parent page and the iframe.
本文标签: javascriptPossible Ways to Communicate Between iFrame and Parent Page across domainsStack Overflow
版权声明:本文标题:javascript - Possible Ways to Communicate Between iFrame and Parent Page across domains - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741115812a2342355.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论