From 11873af54538c228de48093fe8f90c2727a8c57e Mon Sep 17 00:00:00 2001 From: KimChungO Date: Mon, 22 Jan 2024 22:14:29 +0900 Subject: [PATCH] =?UTF-8?q?[Update]2048=20url=EB=A1=9C=20=EB=8D=B0?= =?UTF-8?q?=EC=9D=B4=ED=84=B0=20=EB=B0=9B=EA=B8=B0=20=ED=85=8C=EC=8A=A4?= =?UTF-8?q?=ED=8A=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- game-server/src/main/resources/static/2048.html | 2 +- game-server/src/main/resources/static/2048.js | 13 ++++++++----- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/game-server/src/main/resources/static/2048.html b/game-server/src/main/resources/static/2048.html index 7fa4afd..bf03cd4 100644 --- a/game-server/src/main/resources/static/2048.html +++ b/game-server/src/main/resources/static/2048.html @@ -43,7 +43,7 @@ - + diff --git a/game-server/src/main/resources/static/2048.js b/game-server/src/main/resources/static/2048.js index fed6cac..33792b0 100644 --- a/game-server/src/main/resources/static/2048.js +++ b/game-server/src/main/resources/static/2048.js @@ -11,11 +11,14 @@ var tableID = Array( Array("30", "31", "32", "33") ); var score; -var userId = null; -window.addEventListener("message", function (event) { - document.getElementById("receivedData").textContent = event.data; - userId = event.data; -}); +// var userId = null; +// window.addEventListener("message", function (event) { +// document.getElementById("receivedData").textContent = event.data; +// userId = event.data; +// }); + +const urlParams = new URLSearchParams(window.location.search); +var userId = urlParams.get("userId"); // 키보드 입력 처리 document.onkeydown = keyDownEventHandler;