forked from blueimp/JavaScript-Templates
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdemoByminyin.html
More file actions
100 lines (96 loc) · 2.22 KB
/
demoByminyin.html
File metadata and controls
100 lines (96 loc) · 2.22 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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
<!-- By minyin -->
<h1>Status_Title</h1>
<h3>Status_Description</h3>
<table>
<tr>
<td colspan="8">Status_Table_Title</td>
</tr>
<tr>
<td>Device_Id</td>
<td>Chip_Info</td>
<td>Status</td>
<td>Frequency</td>
<td>Methods</td>
<td>Speed</td>
<td>Type</td>
<td>Power</td>
</tr>
</table>
<div id="tmpl_traffic">This is a div</div>
<script src="../js/tmpl.min.js"></script>
<script type="text/x-tmpl" id="tmpl-demo">
<h3>{%=o.title%}</h3>
<p>Released under the
<a href="{%=o.license.url%}">{%=o.license.name%}</a>.</p>
<h4>Features</h4>
<ul>
{% for (var i=0; i<o.features.length; i++) { %}
<li>{%=o.features[i]%}</li>
{% } %}
</ul>
</script>
<script>
var data = {
"title": "JavaScript Templates",
"license": {
"name": "MIT license",
"url": "http://www.opensource.org/licenses/MIT"
},
"features": [
"lightweight & fast",
"powerful",
"zero dependencies"
]
};
//$dot = $("#tmpl_traffic");
//$dot.nextAll().remove();
document.getElementById("tmpl_traffic").innerHTML = tmpl("tmpl-demo", data);
//$("#tmpl_traffic").innerHTML = tmpl("tmpl-demo", data);
//$(tmpl('tmpl-demo', data)).insertAfter($dot)
</script>
<!--script type="text/x-tmpl" id="tmpl_traffic">
{% $.each(o, function(id, it){ %}
<tr>
<td>{%=id %}</td>
<td>{%=it.ChipInfo %}</td>
<td>{%=it.LockStatus %}</td>
<td>{%=it.Freq %}</td>
<td>{%=it.Methods %}</td>
<td>{%=it.Speed %}</td>
<td>{%=it.Type %}</td>
<td>{%=it.Power %}</td>
</tr>
{% }}) %}
</script-->
<!--script>
var data = {
"title": "JavaScript Templates",
"license": {
"name": "MIT license",
"url": "http://www.opensource.org/licenses/MIT"
},
"data":{
"1":{
"ChipInfo": "Qualcomm",
"LockStatus": "Lock",
"Freq": "1150",
"Methods": "Hide",
"Speed": "High",
"Type": "na",
"Power": "300w"
},
"2":{
"ChipInfo": "Intel",
"LockStatus": "Not Lock",
"Freq": "1250",
"Methods": "Hide",
"Speed": "High",
"Type": "ie",
"Power": "500w"
}
}
};
$dot = $('[data-tmpl-replace="tmpl_traffic"]');
$dot.nextAll().remove();
$(tmpl('tmpl_traffic', data.data)).insertAfter($dot)
</script-->