Advertisement
Guest User

Untitled

a guest
Apr 17th, 2014
42
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. <script>
  2. var w = window.open('http://studiothorn.com/recive.html');
  3. w.postMessage('anand.', 'http://studiothorn.com');
  4. w.postMessage('aff.', 'http://studiothorn.com');
  5. function receiveMessage(event)
  6. {
  7. alert("hello");
  8. if (event.origin !== "http://studiothorn.com")
  9. return;
  10. }
  11. window.addEventListener("message", receiveMessage, false);
  12. </script>
  13.  
  14. and secondly code is about reciver
  15.  
  16. function receiveMessage(event)
  17. {
  18. alert("aff");
  19. if (event.origin !== "http://studiothorn.com")
  20. return;
  21. event.source.postMessage("hi there yourself! the secret response " +"is:
  22. rheeeeet!",event.origin);
  23. }
  24. window.addEventListener("message", receiveMessage, false);
  25.  
  26. . in second code is about reciving text send by the sender.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement