From ASDSO Dam Safety Toolbox
|
|
| Line 35: |
Line 35: |
| } | | } |
|
| |
|
| window.parent.postMessage('Hello Parent Frame!', '*');
| | |
| window.addEventListener('message', receiveMessage, false);
| |
| function receiveMessage(evt)
| |
| {
| |
| console.log("here");
| |
| console.log(evt);
| |
| // if (evt.origin === 'http://my.iframe.org')
| |
| // {
| |
| // alert("got message: "+evt.data);
| |
| // }
| |
| }
| |
| document.querySelector("iframe").addEventListener( "message", function(e) {
| |
| console.log("and here");
| |
| });
| |
| </script> | | </script> |
| </html> | | </html> |
Revision as of 16:11, 7 July 2023