mirror of
https://gitlab.fdmci.hva.nl/technische-informatica-sm3/ti-projectten/rooziinuubii79.git
synced 2025-08-03 20:04:58 +00:00
comments and cleanup
This commit is contained in:
@@ -32,10 +32,9 @@ document.querySelectorAll(".btn").forEach(button => {
|
|||||||
// Parse the data and show it on the website
|
// Parse the data and show it on the website
|
||||||
async function parseData() {
|
async function parseData() {
|
||||||
const data = await fetchData();
|
const data = await fetchData();
|
||||||
console.log("Fetched data:", data); // Log the fetched data
|
|
||||||
const sensorDataContainer = document.getElementById("sensor-data");
|
const sensorDataContainer = document.getElementById("sensor-data");
|
||||||
sensorDataContainer.innerHTML = ""; // Clear previous data
|
sensorDataContainer.innerHTML = ""; // Clear previous data
|
||||||
|
//for each object in json array create a new paragraph element and append it to the sensorDataContainer
|
||||||
for (const [key, value] of Object.entries(data)) {
|
for (const [key, value] of Object.entries(data)) {
|
||||||
const dataElement = document.createElement("p");
|
const dataElement = document.createElement("p");
|
||||||
dataElement.textContent = `${key}: ${value}`;
|
dataElement.textContent = `${key}: ${value}`;
|
||||||
|
Reference in New Issue
Block a user