Created
November 13, 2013 15:26
-
-
Save qubird/7450883 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // In the parent frame | |
| window.addEventListener("message", function(evt) { | |
| var data; | |
| console.debug("Got message: ", evt); | |
| data = JSON.parse(evt.data); | |
| // Do something... | |
| }, false); | |
| // In the child frame | |
| window.parent.postMessage(JSON.stringify({action: "doSomething", args: {foo: "1}}), "*"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment