D3
OG
Old school D3 from simpler times
All examples
By author
By category
About
AnsonT
Full window
Github gist
HTML5 MessageChannel
<!DOCTYPE html> <html> <script type="text/javascript"> function click2() { console.log("click"); window.framePort.postMessage("Click Message From Parent"); } function load() { console.log("load index"); window.addEventListener("message", onMessage, false); window.postMessage("test message", "*"); } function onFrameMessage(e) { console.log("In Parent"); console.log(e); } function onMessage(e) { console.log(e); if (e.data === "channel") { console.log(e.ports[0]); window.framePort = e.ports[0] window.framePort.onmessage = onFrameMessage } } </script> <body onload="load()"> <button onclick="click2()">Send To Frame</button> <iframe src="frame.html"></iframe> </body> </html>