added name parameter for requesting data with name
This commit is contained in:
@@ -10,9 +10,10 @@ function sendData(naam, score) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function getData(){
|
function getData(name){
|
||||||
// Fetch data from the database, put it in an array, and log it to the console
|
// 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
|
//met backticks als " " kan je variabelen in een string zetten
|
||||||
|
return fetch (`https://oege.ie.hva.nl/~hossan/getData.php?name=${name}`) // Add return here
|
||||||
.then(response => response.json())
|
.then(response => response.json())
|
||||||
.then(data => {
|
.then(data => {
|
||||||
requesteddata = data;
|
requesteddata = data;
|
||||||
|
Reference in New Issue
Block a user