-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathfetch.html
121 lines (106 loc) · 3.67 KB
/
fetch.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
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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
<!DOCTYPE html>
<html lang="en">
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta content="width=device-width, initial-scale=1.0" name="viewport" />
<title>Leader Board - CA</title>
<meta content="" name="descriptison" />
<meta content="" name="keywords" />
<!-- Favicons -->
<link href="assets/img/favicon.png" rel="icon" />
<link href="assets/img/apple-touch-icon.png" rel="apple-touch-icon" />
<!-- Google Fonts -->
<link
href="https://fonts.googleapis.com/css?family=Open+Sans:300,300i,400,400i,600,600i,700,700i|Raleway:300,300i,400,400i,600,600i,700,700i"
rel="stylesheet"
/>
<!-- Vendor CSS Files -->
<link
href="assets/vendor/bootstrap/css/bootstrap.min.css"
rel="stylesheet"
/>
<link href="assets/vendor/icofont/icofont.min.css" rel="stylesheet" />
<link
href="assets/vendor/boxicons/css/boxicons.min.css"
rel="stylesheet"
/>
<link href="assets/vendor/venobox/venobox.css" rel="stylesheet" />
<link
href="assets/vendor/owl.carousel/assets/owl.carousel.min.css"
rel="stylesheet"
/>
<link href="assets/vendor/aos/aos.css" rel="stylesheet" />
<!-- Template Main CSS File -->
<link href="assets/css/style.css" rel="stylesheet" />
</head>
<body>
<div class="container text-center my-4">
<p class="font-weight-bold">
The data in the table comes from the google spreadsheet
</p>
<a
class="btn btn-primary mb-4"
href="https://docs.google.com/spreadsheets/d/1PZGUKu4ErcdJaA5KrclXqDDzgp9GNo4TlZeyDu7YZns/edit?usp=sharing"
role="button"
target="_blank"
>Click to see the source sheet</a
>
<!-- Table -->
<table class="table table bordered table-striped" id="testTable">
<!-- Table head -->
<thead>
<tr>
<th>Name</th>
<th>Age</th>
<th>E-mail</th>
</tr>
</thead>
<!-- Table head -->
<!-- Table body -->
<tbody id="demo"></tbody>
<!-- Table body -->
</table>
<!-- Table -->
</div>
<!-- Start your project here-->
<!-- /Start your project here-->
<!-- SCRIPTS -->
<!-- JQuery -->
<script type="text/javascript" src="js/jquery-3.3.1.min.js"></script>
<!-- Bootstrap tooltips -->
<script type="text/javascript" src="js/popper.min.js"></script>
<!-- Bootstrap core JavaScript -->
<script type="text/javascript" src="js/bootstrap.min.js"></script>
<!-- MDB core JavaScript -->
<script type="text/javascript" src="js/mdb.min.js"></script>
<script type="text/javascript">
$.getJSON(
"https://spreadsheets.google.com/feeds/list/1PZGUKu4ErcdJaA5KrclXqDDzgp9GNo4TlZeyDu7YZns/od6/public/values?alt=json",
function (data) {
var sheetData = data.feed.entry;
var i;
for (i = 0; i < sheetData.length; i++) {
var name = data.feed.entry[i]["gsx$_cn6ca"]["$t"];
var age = data.feed.entry[i]["gsx$_cokwr"]["$t"];
var email = data.feed.entry[i]["gsx$_cpzh4"]["$t"];
document.getElementById("demo").innerHTML +=
"<tr>" +
"<td>" +
name +
"</td>" +
"<td>" +
age +
"</td>" +
"<td>" +
email +
"</td>" +
"</tr>";
}
}
);
</script>
</body>
</html>
</html>