-
Notifications
You must be signed in to change notification settings - Fork 0
/
if.html
74 lines (63 loc) · 2.81 KB
/
if.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
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
<!DOCTYPE html>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<body>
<h3>Links</h3>
<form action="/down" method="get">
<input type="text" id="fname" name="fname"><br>
<input type="submit" id="fname" name="fname" value="Go!"><br>
</form>
<form action="/clip" method="get">
<input type="submit" id="fname" name="fname" value="Use Copied"><br>
</form>
<h3>Files</h3>
<table id="excelDataTable" border="1" >
</table>
</body>
<script>
var myList = { "name": "abc", "age": 50,"age": 50,"age": 50 };
function buildHtmlTable(selector) {
var columns = Object.keys(myList)
console.log(columns);
for (var i = 0; i < columns.length; i++) {
var row$ = $('<tr/>');
row$.append($('<td/>').html( '   ' + columns[i] + '      ' ) );
row$.append($('<td/>').html( '   ' + myList[columns[i]] + '   ' ));
$(selector).append(row$);
}
}
function kill(selector) {
try {
document.getElementById(selector).deleteRow(0);
document.getElementById(selector).deleteRow(0);
document.getElementById(selector).deleteRow(0);
document.getElementById(selector).deleteRow(0);
document.getElementById(selector).deleteRow(0);
document.getElementById(selector).deleteRow(0);
document.getElementById(selector).deleteRow(0);
document.getElementById(selector).deleteRow(0);
document.getElementById(selector).deleteRow(0);
document.getElementById(selector).deleteRow(0);
document.getElementById(selector).deleteRow(0);
document.getElementById(selector).deleteRow(0);
document.getElementById(selector).deleteRow(0);
document.getElementById(selector).deleteRow(0);
document.getElementById(selector).deleteRow(0);
document.getElementById(selector).deleteRow(0);
document.getElementById(selector).deleteRow(0);
document.getElementById(selector).deleteRow(0);
document.getElementById(selector).deleteRow(0);
document.getElementById(selector).deleteRow(0);
document.getElementById(selector).deleteRow(0);
document.getElementById(selector).deleteRow(0);
document.getElementById(selector).deleteRow(0);
} catch (error) {
}}
setInterval(() => {
$.getJSON("/vids", function (data) {
console.log(data);
kill('excelDataTable')
myList = data;
buildHtmlTable('#excelDataTable');
});
}, 1000);
</script>