daily pastebin goal
72%
SHARE
TWEET

Parent site

a guest Nov 22nd, 2017 48 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4.     <meta charset="UTF-8">
  5.     <title>Title</title>
  6. </head>
  7. <body>
  8. <script>
  9.     window.addEventListener('message', function (e) {
  10.  
  11.         console.log('message');
  12.  
  13.         e.source.postMessage('messageToIframe', '*');
  14.  
  15.     }, false);
  16. </script>
  17.  
  18. <iframe src="http://localhost:63343/untitled/index.html" frameborder="0" width="800" height="600"></iframe>
  19.  
  20. <!--<script>-->
  21.     <!--document.querySelector('iframe').addEventListener('load', function (e) {-->
  22.  
  23.         <!--e.target.contentWindow.postMessage('some', '*');-->
  24.  
  25.     <!--}, false);-->
  26. <!--</script>-->
  27. </body>
  28. </html>
RAW Paste Data
Top