- 기본
- 송신
1 2
window.parent.postMessage( data, [ports], targetOrigin ); //자식 - 부모 child.contentWindow.postMessage( data, [posts] , targetOrigin ); // 부모 - 자식
 - 수신
1 2 3 4
window.addEventListener( 'message', function( e ) { // e.data가 전달받은 메시지 console.log( e.data ); } );출처 : http://blog.302chanwoo.com/2016/08/postmessage/
 
 - 송신
 
Iframe메세지전달
 This post is licensed under  CC BY 4.0  by the author.
Comments powered by Disqus.