Published
Edited
Apr 25, 2020
Insert cell
Insert cell
Insert cell
Insert cell
html` <div id="msg" >No msg received yet...</div>`
Insert cell
window.addEventListener("message", event => {
console.log(event);
if (event.origin != "https://observablehq.com") {
let txt = document.querySelector("#msg");
txt.innerHtml = `msg is ${JSON.stringify(event.data)}`;
}
})
Insert cell
Insert cell
// messages sent from here do not go through either
window.parent.postMessage('toto', '*')
Insert cell
//window.parent
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more