Skip to content

Instantly share code, notes, and snippets.

@jbail
Last active December 10, 2015 09:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jbail/4414037 to your computer and use it in GitHub Desktop.
Save jbail/4414037 to your computer and use it in GitHub Desktop.
window.postMessage
//postMessage using an iFrame
var iframe = document.getElementById('my-iframe').contentWindow;
iframe.postMessage('good morning', 'http://jeffbail.com/');
//postMessage using a Window
var win = window.open('http://someawesomeurl.com', 'someawesomeurl');
win.postMessage('good evening', 'http://jeffbail.com/');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment