Can scripts in iframe interact with scripts in the main page

前端 未结 5 2095
遥遥无期
遥遥无期 2021-01-13 06:03

I have an editor with an SWF multi-image uploader. Since not everyone will need to upload pictures in their article, i need to dynamically load this image uploader when nece

5条回答
  •  天命终不由人
    2021-01-13 06:43

    If the iframe is from a different domain, but you have control over the content, you can communicate between the two in a couple different ways. The simplest is to "talk" through key/value pairs in the URL of the iFrame, since both the parent and the iFrame have access to that.

    A more complicated approach is to use iFrame proxy's, which is described really well here: http://www.julienlecomte.net/blog/2007/11/31/ which uses Yahoo Pipes to send messages back and forth quite nicely.

提交回复
热议问题