INF.03-01-25.01-SG/script.js
2025-09-17 13:57:23 +02:00

9 lines
411 B
JavaScript

document.addEventListener('DOMContentLoaded', () => {
fetch('get.php')
.then(r => r.json())
.then(data => {
const table = document.getElementById('tab');
table.innerHTML = `<tr><th>Kurs</th><th>Czas trwania</th><th>Cena</th>` +
data.map($row => `<tr><td>${$row.nazwa}</td><td>${$row.czas_trwania}</td><td>${$row.cena}</td></tr>`).join('');
});
});