Code optimization
This commit is contained in:
@@ -1,13 +1,6 @@
|
|||||||
|
|
||||||
function sendData(naam, score) {
|
function sendData(naam, score) {
|
||||||
const request = ( url, params = {}) => {
|
fetch (`https://oege.ie.hva.nl/~hossan/postData.php?name=${naam}&score=${score}`)
|
||||||
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(name){
|
function getData(name){
|
||||||
|
Reference in New Issue
Block a user