window.postMessage

2084 단어 message
 

//http://www.onlineaspect.com/2010/01/15/backwards-compatible-postmessage/

//http://blog.joycode.com/saucer/archive/2006/10/03/84572.aspx

//https://developer.mozilla.org/en/DOM/window.postMessage

<!doctype html>



<html>



  <head>



    <title>postMessage by     </title>



    <meta charset="utf-8"/>



    <meta content="IE=8" http-equiv="X-UA-Compatible"/>



    <meta name="keywords" content="postMessage by     " />



    <meta name="description" content="postMessage by     " />







    <style>







    </style>



    <script type="text/javascript" charset="utf-8">



      window.onload = function(){   

        if(window.attachEvent){//      

          window.attachEvent('onmessage', function(e) {

            alert(window.event.data+"IE")

            alert(e.data+"IE2") ;

          })

        }else{

          window.addEventListener('message',function(e) {

            alert(e.data+"     ");

          },false);

        }

        window.postMessage("    ", document.URL);

      }

    </script>



  </head>



  <body>







  </body>



</html>





postMessage by 사도 정미






window.onload = function(){
if(window.attachEvent){//바 인 딩 후 감청
window.attachEvent('onmessage', function(e) {
alert(window.event.data+"IE")
alert(e.data+"IE2") ;
})
}else{
window.addEventListener('message',function(e) {
alert(e.data+"표준 브 라 우 저");
},false);
}
window.postMessage("사도 정미",document.URL);
}





실행 코드

좋은 웹페이지 즐겨찾기