Possible Ways to Communicate Between iFrame and Parent Page across domains

前端 未结 4 1227
长情又很酷
长情又很酷 2020-12-18 08:04

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.<

4条回答
  •  死守一世寂寞
    2020-12-18 08:11

    easyXDM is designed for this exact purpose. You can find it at http://easyxdm.net and it has quite a few examples.

    To sum it up, it allows two windows to communicate 'freely' using either strings or RPC calls.

    See http://consumer.easyxdm.net/current/example/methods.html for one of the RPC-demos.

提交回复
热议问题