forked from newzqy/rubylouvre.github.com
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpost.html
More file actions
29 lines (25 loc) · 720 Bytes
/
post.html
File metadata and controls
29 lines (25 loc) · 720 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<!DOCTYPE HTML>
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>测试</title>
<script >
window.onmessage = function(e){
var event = e || window.event;
try{
console.log(event);
console.log(event.data)
console.log(event.data.aaa)
}catch(e){}
event.source.postMessage("好的,我已经收到你的消息了", event.origin);
}
</script>
</head>
<body>
<p>测试 HTML5的 postMessage by 司徒正美</p>
<iframe id="aaa" src="http://www.cnblogs.com/rubylouvre/articles/2956254.html">
</iframe>
</body>
</html>