-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex1.html
33 lines (31 loc) · 1.04 KB
/
index1.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
<html>
<head>
<meta charset="UTF"/>
<title>My nginx project</title>
<link rel="stylesheet" href="./styles.css">
</head>
<body>
<h1>Hello my friends, I am served from NGINX.</h1>
</body>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/papaparse.min.js"></script>
<script>
fetch('http://localhost:8080/GCH_A2022.csv')
.then(response => response.text())
.then(data => {
parsedData = Papa.parse(data, { header: true }).data;
console.log(parsedData); // do whatever you want with the array here
});
</script>
<script>
// var xhttp = new XMLHttpRequest();
// xhttp.open("GET", "http://localhost:8080/fichier_cours.json", true);
// xhttp.setRequestHeader("Content-Type","application/json");
// xhttp.send();
// xhttp.onreadystatechange = function() {
// if (this.readyState == 4 && this.status == 200) {
// var data = JSON.parse(this.responseText);
// console.log(data[1].titre_cours);// Do something with the data here
// }
// };
</script>
</html>