首页 > 解决方案 > 在外部 iframe 上填充输入

问题描述

我想在加载 iframe 时自动填充网站上的文本框,它应该填写输入文本表单。(我的应用程序和 iframe 不在同一个域中)我想知道是否有解决方案可以使这个可行

标签: reactjsiframe

解决方案


If you have control over both origins, then you can use the window.postMessage API to communicate between the iframe and the parent page.

If you do not have control over both origins, I don't think you can do that because of the same-origin policy.


推荐阅读