$(function () { function a(a) { return this._strings = new Array, a && (this._strings[0] = a), this } function f(a) { d.css("display", "none"), c.text(a).css({ color: "red", display: "block" }) } function g(b) { c.css("display", "none"), e.text("正在查询数据..."), d.css("display", "block"), $.ajax({ url: "GetStudentResult.ashx", type: "post", data: { key: b }, dataType: "json", success: function (b) { var c, g; if (e.text("查询成功，正在处理数据..."), b) { if (b.length < 1) return f("没有查询到相关的数据。"), !1; c = new a; for (g in b) c.append('<table class="result"><thead><tr><td class="result_Title" colspan="4">隶属考试：'), c.append(b[g].ToolResuSou_ExamCode_Id), c.append("</td></tr></thead>"), c.append("<tr><th>考号：</th><td>"), c.append(b[g].ToolResuSou_ExamId), c.append("</td><th>姓名：</th><td>"), c.append(b[g].ToolResuSou_Name), c.append("</td></tr>"), c.append("<tr><th>语文：</th><td>"), c.append(-1 == b[g].ToolResuSou_Chinese ? "" : b[g].ToolResuSou_Chinese), c.append("</td><th>数学：</th><td>"), c.append(-1 == b[g].ToolResuSou_Math ? "" : b[g].ToolResuSou_Math), c.append("</td></tr>"), c.append("<tr><th>英语：</th><td>"), c.append(-1 == b[g].ToolResuSou_English ? "" : b[g].ToolResuSou_English), c.append("</td><th>物理：</th><td>"), c.append(-1 == b[g].ToolResuSou_Physics ? "" : b[g].ToolResuSou_Physics), c.append("</td></tr>"), c.append("<tr><th>化学：</th><td>"), c.append(-1 == b[g].ToolResuSou_Chem ? "" : b[g].ToolResuSou_Chem), c.append("</td><th>政治：</th><td>"), c.append(-1 == b[g].ToolResuSou_Politics ? "" : b[g].ToolResuSou_Politics), c.append("</td></tr>"), c.append("<tr><th>生物：</th><td>"), c.append(-1 == b[g].ToolResuSou_Organism ? "" : b[g].ToolResuSou_Organism), c.append("</td><th>地理：</th><td>"), c.append(-1 == b[g].ToolResuSou_Geography ? "" : b[g].ToolResuSou_Geography), c.append("</td></tr>"), c.append("<tr><th>历史：</th><td>"), c.append(-1 == b[g].ToolResuSou_History ? "" : b[g].ToolResuSou_History), c.append("</td><th></th><td></td></tr>"), c.append("<tr><th>班级：</th><td>"), c.append(b[g].ToolResuSou_Class), c.append("</td><th>总分：</th><td>"), c.append(b[g].ToolResuSou_SumResult), c.append("</td></tr>"), c.append("<tr><th>班级排名：</th><td>"), c.append(b[g].ToolResuSou_ClassRanking), c.append("</td><th>学校排名：</th><td>"), c.append(b[g].ToolResuSou_SchoolRanking), c.append("</td></tr>"), c.append("<tr><th>历史排名：</th><td>"), c.append(b[g].ToolResuSou_Former), c.append("</td><th>进退对比：</th><td>"), c.append(b[g].ToolResuSou_Compare), c.append("</td></tr>"), c.append("</table>"); return $("#resultList").html(c.toString()), d.css("display", "none"), !0 } return f("查询数据异常，请检查您的网络信息，或稍后重新尝试。"), !1 }, error: function () { return f("网络连接异常，请检查您的网络信息，或稍后重新尝试。"), !1 } }) } var b, c, d, e; a.prototype.append = function (a) { this._strings.push(a) }, a.prototype.toString = function () { return this._strings.join("") }, b = $("#searchBar"), c = $("#promptContext"), d = $("#loading"), e = $("#loadingText"), $("#searchLink").click(function () { var a = jQuery.trim(b.val()); return "" == a || 0 == a.length ? !1 : (g(a), void 0) }), $("#searchBar").keyup(function (a) { var b = window.event ? a.keyCode : a.which; return 13 == b ? ($("#searchLink").click(), !1) : void 0 }) });