This commit is contained in:
2021-11-01 14:03:35 +08:00
parent 7e9999d30d
commit 8483f13aa3
4 changed files with 83 additions and 2 deletions

59
mask.html Normal file
View File

@@ -0,0 +1,59 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js"
integrity="sha512-894YE6QWD5I59HgZOGReFYm4dnWc1Qt5NtvYSaNcOP+u1T9qYdvdihz0PPSiiqn/+/3e7Jo4EaG7TubfWGUrMQ=="
crossorigin="anonymous" referrerpolicy="no-referrer"></script>
</head>
<body>
<table border=1>
<tr>
<td>藥局名稱</td>
<td>成人口罩剩餘數量</td>
<td>兒童口罩剩餘數量</td>
</tr>
<tbody id="row">
</tbody>
</table>
<script>
$.ajax({
url: 'https://findmasks.herokuapp.com/places',
type: 'get',
dataType: 'json',
success: function (data) {
for (i = 0; i < 20; i++) {
$("#row").append("<tr>"+"<td>" + data.features[i].properties.name + "</td>" +
"<td>" + data.features[i].properties.masksLeft + "</td>" +
"<td>" + data.features[i].properties.childMasksLeft + "</td>"+"</tr>")
}
},
error: function (xhr) {
console.log('api catch error');
}
});
if(localStorage.getItem('LoginStatus')!=1){
alert('請重新登入後再試');
location.href='Untitled-1.html';
}
</script>
</body>
</html>