comments and cleanup

This commit is contained in:
2024-11-06 14:01:39 +01:00
parent 6dba1d0262
commit 89b608b759

View File

@@ -32,10 +32,9 @@ document.querySelectorAll(".btn").forEach(button => {
// Parse the data and show it on the website
async function parseData() {
const data = await fetchData();
console.log("Fetched data:", data); // Log the fetched data
const sensorDataContainer = document.getElementById("sensor-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)) {
const dataElement = document.createElement("p");
dataElement.textContent = `${key}: ${value}`;