iFrame
✓ Published0🌍 Public
This example demonstrates bidirectional communication between an embedded iframe and its parent page using the HTML5 `postMessage` API and the `window.addEventListener('message')` event. It shows how a child document can display messages sent from the parent, and how a user can type text into an input field and send it back to the parent via `window.parent.postMessage`. The page is a minimal HTML document with inline CSS styling and vanilla JavaScript, requiring no external libraries or frameworks. It serves as a bare-bones template for cross-origin messaging patterns in web visualization contexts.
AI-generated descriptionA bare minimum HTML page demonstrating use of CSS and JavaScript.
See also React Starter.
MIT Licensed