forked from wteam-xq/testDemo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
BOM_demo.html
49 lines (42 loc) · 1.45 KB
/
BOM_demo.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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<!DOCTYPE html>
<html>
<head>
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-COMPATIBLE" content="IE=edge,chrome=1"/>
<meta charset="utf-8">
<title>
BOM理解
</title>
<link rel="icon" href="favicon.ico" type="image/x-icon" />
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon" />
</head>
<body>
<h3>BOM理解</h3>
<h4>最常用:</h4>
<h5> Navigator - userAgent:</h5>
<div id="agent_cont"></div>
<h5>Location - href/hash/search </h5>
<div id="href_cont"></div>
<div id="hash_cont"></div>
<div id="port_cont"></div>
<div id="search_cont"></div>
<script>
var BomObj = null;
BomObj = {
init: function(){
var agentDom = document.getElementById('agent_cont'),
hrefDom = document.getElementById('href_cont'),
hashDom = document.getElementById('hash_cont'),
portDom = document.getElementById('port_cont'),
searchDom = document.getElementById('search_cont');
agentDom.innerHTML = window.navigator.userAgent;
hrefDom.innerHTML = window.location.href;
hashDom.innerHTML = window.location.hash;
portDom.innerHTML = window.location.port;
searchDom.innerHTML = window.location.search;
}
};
BomObj.init();
</script>
</body>
</html>