summaryrefslogtreecommitdiff
path: root/index.html
diff options
context:
space:
mode:
Diffstat (limited to 'index.html')
-rw-r--r--index.html8
1 files changed, 6 insertions, 2 deletions
diff --git a/index.html b/index.html
index 087a099..97934e5 100644
--- a/index.html
+++ b/index.html
@@ -31,7 +31,10 @@ socket.on("roomgameturn",roomgameturn);
socket.on("roomgameplace",roomgameplace);
socket.on("roomgamewin",roomgamewin);
-if(location.hostname=="localhost"&&Math.random()<.25)localStorage.setItem("nickname","aaa");
+if(location.hostname=="localhost"&&Math.random()<.25){
+ try{localStorage.setItem("nickname","aaa");}
+ catch(e){}
+}
if(localStorage.getItem("nickname"))socket.emit("setnick",localStorage.getItem("nickname"));
else socket.emit("me",updateme);
@@ -40,7 +43,8 @@ socket.emit("userlist",updateuserlist);
function updateme(_me){
me=_me;
document.getElementById("nickname").innerHTML=me[1];
- localStorage.setItem("nickname",me[1]);
+ try{localStorage.setItem("nickname",me[1]);}
+ catch(e){}
}
function updateuserlist(_ul){