Advertisement
Guest User

Untitled

a guest
Jun 24th, 2016
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. // If you send `message` it gets caught by the custom defined event
  2. this.postMessage({message: 'something', bar: 'baz'});
  3.  
  4. // But not this. It will get caught by the global one
  5. this.postMessage({zazz: 'jazz'});
  6.  
  7. // To check messages from iframe
  8. ApplicationFooBar.prototype.onPostMessage = function(message, ev) {
  9. console.warn(message.cool); // === "Awesome"
  10. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement