Given:
var myWindow = open("foo.bar");
Old method: change the name property of the window object:
myWindow.name = "..."; // in foo.bar: setInterval(someFunctionToCheckForChangesInName, 100);
HTML5 method: call the window postMessage method:
myWindow.postMessage("...", "*"); // in foo.bar: (window.addEventListener || window.attachEvent)( (window.attachEvent && "on" || "") + "message", function (evt) { var data = evt.data; // this is the data sent to the window // do stuff with data }, false);
Eli gray
source share