diff options
author | Mark Powers <markppowers0@gmail.com> | 2020-04-12 14:42:03 -0500 |
---|---|---|
committer | Mark Powers <markppowers0@gmail.com> | 2020-04-12 14:42:03 -0500 |
commit | 7e6648902b262484bc0aac824c3784b1ae4b8591 (patch) | |
tree | bc56275222a58228fd714af0dad58c660f004ab7 /src/highscores.js | |
parent | 1bffb064e2414ced5b1924a4f9fbd822a09c718e (diff) |
Update games, add scores
Diffstat (limited to 'src/highscores.js')
-rw-r--r-- | src/highscores.js | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/highscores.js b/src/highscores.js new file mode 100644 index 0000000..e735eee --- /dev/null +++ b/src/highscores.js @@ -0,0 +1,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 +}
\ No newline at end of file |