From 35942874226ddfb9d01fa1f3b5d02208aa44f07f Mon Sep 17 00:00:00 2001 From: jakubk Date: Mon, 20 May 2024 10:25:16 +0200 Subject: [PATCH] third commit --- fetch.js | 2 +- get.php | 8 ++++---- js.js | 21 --------------------- 3 files changed, 5 insertions(+), 26 deletions(-) delete mode 100644 js.js diff --git a/fetch.js b/fetch.js index d106a25..46b262a 100644 --- a/fetch.js +++ b/fetch.js @@ -1,4 +1,4 @@ -const url = "http://localhost/P20.05/get.php" +const url = "http://localhost/p20/get.php" fetch(url) .then(response => response.json()) diff --git a/get.php b/get.php index 6f983d5..3c36680 100644 --- a/get.php +++ b/get.php @@ -1,8 +1,8 @@ response.json()) - .then( data => { - console.log(data) - }) - -function sortujSufiksy() { - const slowo = document.getElementById('slowo').value; - const sufiksy = []; - for (let i = 0; i < slowo.length; i++) { - sufiksy.push(slowo.slice(i)); - } - document.getElementById('nieposortowane').textContent = formatSufiksy(sufiksy); - sufiksy.sort(); - document.getElementById('posortowane').textContent = formatSufiksy(sufiksy); -} -function formatSufiksy(sufiksy) { - return sufiksy.map((sufiks, index) => `${index + 1} ${sufiks}`).join('\n'); -}