Oscar Tong
Everything that has a beginning has an end.
var myIframe = document.getElementById('myFrame');
myIframe.contentWindow.postMessage('hello', '*');
window.addEventListener('message', receiveMessage, false);
function receiveMessage(event){
if(event.origin !== 'http://www.google.com:8080') return;
event.source.postMessage(
{ret:0, message:'nice talking to you'},
event.origin
);
}
IE8, 9 & Firefox 6.0- only support string as message data
var channel = new MessageChannel();
var channel = new MessageChannel();
var port2 = channel.port2;
By Oscar Tong