//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>

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-02-16
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-06-25
  • 2022-12-23
  • 2022-12-23
  • 2021-05-28
  • 2021-10-12
相关资源
相似解决方案