a1/fetch.js

15 lines
378 B
JavaScript

const url = "http://localhost/dev/get.php"
// const url = "http://qstack.pl:8080/z1/get.php"
let lista
fetch(url)
.then(response => response.json())
.then(data => {
sortujSufiksy(data)
});
function sortujSufiksy(data) {
data.forEach((element) => document.querySelector('#nieposortowane').innerHTML += `<li> ${JSON.stringify(element.osoby)} </li>`);
}