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
| // recieve message | |
| // event object contains: | |
| // - data: message sent | |
| // - origin (host from which the message was sent, e.g. http://blah.example.com) | |
| // - source (reference to a Window object from which message was sent) | |
| function postMessageHandler( event ) { | |
| console.log("We've got a message!"); | |
| console.log("* Message:", event.data); | |
| console.log("* Origin:", event.origin); | |
| console.log("* Source:", event.source); |