execute javascript function in a another iframe when parent is from different domain

后端 未结 4 716
谎友^
谎友^ 2021-01-05 15:59

The page A.com has 2 iframes B.com/page1 and B.com/page2. This is the code of A.com:



        
4条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-01-05 16:36

    As Aaron states, it is not allowed to interact between iframes, but you should take a look at easyXDM, it helps with cross domain communication in javascript:

    http://easyxdm.net/wp/

    Here is the example you might be looking for:

    http://easyxdm.net/wp/2010/03/17/sending-and-receiving-messages/

提交回复
热议问题