//增加30分 function addScore(userId) { console.log(userId); $.ajax({ type: "post", contentType: "application/json", url: "/api/score/edit", dataType: 'json', cache: false, timeout: 600000, data: JSON.stringify({ "userId": userId } ) }).done(function (result) { console.log(result); if ($("td").eq("增加30分")) { $("#" + userId).text("已增加").css("color", "red"); } }) } function f(userName) { console.log(userName); if ($("#" + userName).next().text() == "") { $("#" + userName).next().text("已完成"); } else{ $("#" + userName).next().text(""); } }