ASDSO Dam Safety Toolbox

Template: WhatLinksHere: Difference between revisions

From ASDSO Dam Safety Toolbox
Jump to: navigation, search
No edit summary
No edit summary
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

Usage