aboutsummaryrefslogtreecommitdiff
path: root/src/highscores.js
blob: e735eee8efbb2b8c67ed54c5e2a0dbf0dad27465 (plain)
1
2
3
4
5
6
7
8
9
10
function submitScore(game, score, username){
    if(username == undefined){
        username = prompt("Enter a name to submit score", "");
    }
    if (!(username  == null || username == "")) {
        const request = new Request(`/setScore?game=${game}&username=${username}&score=${score}`);
        fetch(request);
    } 
    return username
}