code cleanup

This commit is contained in:
sam
2024-01-09 13:42:03 +01:00
parent 267be3c86f
commit 5a691023b1
3 changed files with 21 additions and 20 deletions

View File

@@ -710,23 +710,3 @@ function game() {
}
}
function sendData(naam, score) {
const request = ( url, params = {}) => {
url += '?' + ( new URLSearchParams( params ) ).toString();
fetch( url );
};
const get = ( url, params ) => request( url, params);
get('https://oege.ie.hva.nl/~hossan/postData.php', { name: naam, score: score } );
}
function getData(){
// Fetch data from the database, put it in an array, and log it to the console
return fetch ('https://oege.ie.hva.nl/~hossan/getData.php') // Add return here
.then(response => response.json())
.then(data => {
requesteddata = data;
});
}