-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinformation.html
76 lines (65 loc) · 2.31 KB
/
information.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Covid-19 Information - Learn More - Question</title>
<style>
body {
padding: 0;
margin: 0;
}
#qa-container {
background-color: rgb(15, 34, 70);
border-radius: 20px;
color: white;
}
p {
font-size: 21px;
}
</style>
</head>
<body>
<header style="background-color: rgb(10, 32, 65); padding: 25px;">
<p style="color: white; font-family: sans-serif; text-align: center; font-size: 23px;">Generated Question From
The openai Source.
</p>
</header>
<br>
<br>
<div id="qa-container" style="font-family: sans-serif; width: 900px; margin: auto; padding: 25px;">
<!-- Questions and answers will be displayed here -->
</div>
<script>
// Fetch the JSON file
const url = '/center/data/data-provider.json';
fetch(url)
.then(response => {
if (!response.ok) {
throw new Error('Network response was not ok');
}
return response.json();
})
.then(data => {
// Process the JSON data and display it in HTML
const qaContainer = document.getElementById('qa-container');
// Iterate over each question-answer pair
data.forEach(item => {
const question = item.question;
const response = item.response;
// Create HTML elements for question and response
const questionElem = document.createElement('h3');
questionElem.textContent = question;
const responseElem = document.createElement('p');
responseElem.textContent = response;
// Append question and response elements to container
qaContainer.appendChild(questionElem);
qaContainer.appendChild(responseElem);
});
})
.catch(error => {
console.error('There was a problem fetching the data:', error);
});
</script>
</body>
</html>