forked from newzqy/rubylouvre.github.com
-
Notifications
You must be signed in to change notification settings - Fork 0
/
messenger.html
35 lines (31 loc) · 1.05 KB
/
messenger.html
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
30
31
32
33
34
35
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script src="http://files.cnblogs.com/rubylouvre/mass_merge.js"></script>
<script>
require("messenger,event,ready", function(Messenger, $) {
var iframe = $("#iframe");
var messager = new Messenger({
target: '#iframe',
onmessage: function(data) {
$.log(data, true);
if(typeof data == "object"){
$.log(data.aaa,true);
$.log(data.fn,true);
}
}
});
iframe.on("load", function() {
messager.send('发给子页面的消息');
});
})
</script>
</head>
<body>
<p>mass messager 组件 by 司徒正美</p>
<iframe id="iframe" width=800 height=200 src="http://www.cnblogs.com/rubylouvre/articles/2957674.html">
</iframe>
</body>
</html>