Home Iframe메세지전달
Post
Cancel

Iframe메세지전달

  • 기본
    • 송신
      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/

This post is licensed under CC BY 4.0 by the author.

트러블슈팅

@Autowired vs @Required on setter

Comments powered by Disqus.

Trending Tags