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'); -}