Skip to content

Instantly share code, notes, and snippets.

View up209d's full-sized avatar

Duc Duong up209d

View GitHub Profile
@up209d
up209d / README.md
Created September 7, 2019 13:22 — forked from pbojinov/README.md
Two way iframe communication- Check out working example here: http://pbojinov.github.io/iframe-communication/

Two way iframe communication

The main difference between the two pages is the method of sending messages. Recieving messages is the same in both.

Parent

Send messages to iframe using iframeEl.contentWindow.postMessage Recieve messages using window.addEventListener('message')

iframe