-
Notifications
You must be signed in to change notification settings - Fork 1
/
lunch.html
46 lines (42 loc) · 1.39 KB
/
lunch.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
<!DOCTYPE html>
<html>
<head>
<div class="tab">
<button class="tablinks" (click)="function1()">Tab1</button>
<button class="tablinks" (click)="function2()">Tab2</button>
</div>
<link rel="stylesheet" type="text/css" href="lunch.css">
<div class="topnav">
<a class = "logo" href="#lunchhub">Lunch Hub</a>
<a class="active" href="/index.html">Home</a>
<a href="./form.html">Vote</a>
<a href="./lunch.html">Lunch</a>
</div>
<title>My API Page</title>
</head>
<body>
<h1>Today's Lunch</h1>
<script src="api.js"></script>
<div id="website-container">
<iframe src="https://daltonschool.flikisdining.com/menu/dalton-school/lunch/2023-02-24" width="1000" height="1000"></iframe> -->
</div>
<div id="api-data"></div>
<div id="menu"></div>
<script>
fetch('https://daltonschool.flikisdining.com/menu/api/weeks/school/dalton-school/menu-type/lunch/2023/02/24/?format=api')
.then(response => response.json())
.then(data => {
let menu = document.getElementById('menu');
let items = data.menu_items;
let html = '';
items.forEach(item => {
html += `<p>${item.name}</p>`;
});
menu.innerHTML = html;
})
.catch(error => {
console.error('Error:', error);
});
</script>
</body>
</html>