iframe
iframe 跨域双向通信
1 父页面向 iframe 传参 1.1 父页面发消息 // `iframeEl` 是 iframe 所对应的 HTML 元素 iframeEl.contentWindow.postMessage('message body', '*'); 1.2 iframe 监听并校验消息 window.addEventListener('message', function(event) { // IMPORTANT: Check the origin of the data! console.log(event.origin); // 收到消息后一定要校验,防止被恶意利用 if (~event.origin.indexOf(