Upload files to "/"

This commit is contained in:
amarcel 2024-05-21 08:32:05 +00:00
parent 9350d6acdc
commit 603296b456
1 changed files with 22 additions and 0 deletions

22
fetch.js Normal file
View File

@ -0,0 +1,22 @@
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 => {
wyswietlSufiksy(data)
});
function wyswietlSufiksy(data) {
data.forEach((element) => document.querySelector('#nieposortowane').innerHTML += `<li> ${JSON.stringify(element.osoby)} </li>`);
}
document.getElementById("nieposortowane").onmouseover = function() {mouseOver()};
document.getElementById("nieposortowane").onmouseout = function() {mouseOut()};
function mouseOver() {
document.getElementById("nieposortowane").style.color = "red";
}
function mouseOut() {
document.getElementById("nieposortowane").style.color = "black";
}