window.postMessage
//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>
机器瞎学/数据掩埋/模式混淆/人工智障/深度遗忘/神经掉线/计算机幻觉/专注单身二十五年
浙公网安备 33010602011771号