Advertisement
Guest User

Untitled

a guest
Jun 20th, 2019
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. function setIframeUrl() {
  2. var iframeDoc = this.iframeEl.contentWindow.document;
  3. iframeDoc.open().write(
  4. '<body onload="window.location.href='' + this.src + ''; parent.postMessage(
  5. '' + this.iframeLoadedMessage + '', '*')">
  6. </body>
  7. <script>n window.document.onreadystatechange = function () {
  8. if(window.document.readyState === 'complete') {
  9. parent.postMessage('' + this.iframeOnReadyStateChangeMessage + '', '*')
  10. }};
  11. </script>'
  12. );
  13.  
  14. iframeDoc.close();
  15. },
  16.  
  17. <html>
  18. <body class="foo">
  19. Hello World
  20. </body>
  21. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement