diff options
-rw-r--r-- | index.html | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -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){ |