我有 2 个具有以下域的 NodeJS 应用程序:
在 localhost:3000 中,我有一个文本区域和一个提交按钮。
我想将文本区域的内容(使用 postMessage)发布到 localhost:8000/(some_id),并在 localhost:8000 页面上显示内容。
然后,我想在 localhost:3000 页面中显示 localhost:8000/(some_id) 的 iFrame。
我在完成这个任务时遇到了很多麻烦。我必须使用 postMessage() 以这种方式完成它。
PS:我知道最好避免使用 iFrame,但是出于我的应用程序的目的,这是有必要使用的。