commit
This commit is contained in:
59
mask.html
Normal file
59
mask.html
Normal 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>
|
||||
Reference in New Issue
Block a user