How to use JavaScript to access cross domain iFrame content?

后端 未结 6 1307
时光说笑
时光说笑 2021-01-28 16:20

I would like to use this code

window.parent.document.getElementById(\'message\').value  += \"\\r\\n\\r\\n[img]\"+response+\"[/img]\";

It works

6条回答
  •  不思量自难忘°
    2021-01-28 17:14

    Take a look at easyXDM, it's an easy to use library that provides a unified API for several tricks used to enable cross domain messaging, ranging from postMessage to the FIM-trick as a last resort.
    This is what is used by major services such as Twitter and Disqus.

提交回复
热议问题