detail.html
1.05 KB
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
<div id="urllist-detail" class="page out" data-title="URL列表详情">
	<div id="urllist-detail-header"></div>
	<div id="urllist-detail-a"></div>
    <script>
        require(["NavHeader", "Html"], function(NavHeader, Html) {
        	function getParam(key){
        		var result = "";
        		var hash = location.hash;
        		if(location.hash.indexOf("?" != -1)){
        			location.hash.split("?")[1].split("&").forEach(function(item){
        				var splits = item.split("=");
        				if(key == splits[0]){
        					result = splits[1];
        					return;
        				}
        			});
            		
        		}
        		return decodeURIComponent(result);
        	};
        	
        	new NavHeader({
        		el: "urllist-detail-header",
        		option: {
        			title : getParam("title"),
        			smallTitle : getParam("cat")
        		}
        	}).render();
        	
        	new Html({
        		el: "urllist-detail-a",
        		option: {
        			htm: getParam("content")
       			}
        	}).render();
        });
    </script>
</div>