forked from newzqy/rubylouvre.github.com
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnavigator.html
28 lines (28 loc) · 1018 Bytes
/
navigator.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
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<p>测试IE6-7 的navigator hack by 司徒正美</p>
<iframe id="aaa" src="http://www.cnblogs.com/rubylouvre/articles/2956855.html">
</iframe>
<script>
navigator.log = function(msg) {
//由于IE6-7下没有控制台,我们把调试信息打印到页面
var div = document.createElement("div");
div.innerHTML = msg;
document.body.appendChild(div)
}
navigator.a = function(msg) {
navigator.log("这是父页面中的a方法: " + msg);
}
var iframe = document.getElementById("aaa");
iframe.attachEvent && iframe.attachEvent("onload", function() {
setInterval(function() {
window.navigator.b('XXXXX');
}, 3200);
})
</script>
</body>
</html>