iframe-postMessage iframe 跨域通信示例代码 window.postMessage() 方法可以安全地实现跨源通信。 otherWindow.postMessage(message, targetOrigin, [transfer]); 参考链接: MDN 掘金