From 603296b456397e948401bba652d1b1fa73618c67 Mon Sep 17 00:00:00 2001 From: amarcel Date: Tue, 21 May 2024 08:32:05 +0000 Subject: [PATCH] Upload files to "/" --- fetch.js | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 fetch.js diff --git a/fetch.js b/fetch.js new file mode 100644 index 0000000..132e224 --- /dev/null +++ b/fetch.js @@ -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 += `
  • ${JSON.stringify(element.osoby)}
  • `); +} + +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"; +} \ No newline at end of file