2016-04-17 聚沙 postMessage 发送消息 语法 1 otherWindow.postMessage(message, targetOrigin); example 1 2 3 4 window.postMessage({ 'color': 'blue', 'size': 19 }, '*'); 接收消息 1 2 3 4 5 6 window.addEventListener('message', function(event) { if (event.origin !== 'http://yuan.m.taobao.com:8080') return; console.log(event); }, false); 阅读 既然昆虫有趋光性,为什么昆虫不齐刷刷地奔向太阳? Comments Please enable JavaScript to view the comments powered by Disqus.