xjc 2 vuotta sitten
vanhempi
commit
b71584bcc3
1 muutettua tiedostoa jossa 10 lisäystä ja 6 poistoa
  1. 10 6
      rank.html

+ 10 - 6
rank.html

@@ -106,15 +106,16 @@
 			ws.onopen = function () {
 				console.log("open success");
 				localStorage.removeItem("lockReconnect");
-				//定时发送 
-				timer = window.setInterval(function () {
-					ws.send("roundId_"+round_id)
-				}, 1000)
+				var roundId = getQueryString("round_id")
+				ws.send("roundId_"+roundId)
+				// //定时发送 
+				// timer = window.setInterval(function () {
+				// 	ws.send("roundId_"+roundId)
+				// }, 1000)
 			}
-			var $nowWait = $("#nowWait");
 			ws.onmessage = function (e) {
 				var res = JSON.parse(e.data);
-				// console.log(res,11111111)
+				console.log(res,11111111)
 				var len = res.length;
 				$("#nowWait").text(len)
 				var tr = "<tr><th>姓名</th><th>题号</th><th>答案</th><th>耗时</th></tr>"
@@ -125,7 +126,10 @@
 					td += "<td>"+res[i].time+"</td></tr>"
 					tr += td
 				}
+				if(len){
 				$("#rankTbl").html(tr)
+
+				}
 				
 			}
 			ws.onclose = function () {