$(function () { if ($("#txtKey").val() != "请输入机构名称") { $("#txtKey").css("color", "#000"); } $("#ddlArea").change(function () { var te = $("#ddlArea").find("option:selected").text(); if (te == "请选择地域") { $("#curArea").text("所有最新数据"); } else { $("#curArea").text(te+"最新数据"); } GoPage(1); }); GoPage(1); }); function setHref(ob) { $("#ddlArea").val(ob); var te = $("#ddlArea").find("option:selected").text(); $("#curArea").text(te + "最新数据"); GoPage(1); } function GoPage(curpage) { $.ajax({ url: '/Ajax.ashx?' + Math.random(), type: 'post', dataType: 'json', data: { key: $("#txtKey").val(), area: $("#ddlArea").val(), curpage: curpage }, beforeSend: function () { $("#loadinfo").html("数据加载中...."); }, success: function (data) { $("#loadinfo").html(""); var obj = eval(data); $("#pageHtml").html(obj.html); if (obj.dt.length > 0) { var list = obj.dt; var newH = ""; for (var i = 0; i < list.length; i++) { newH += "" + "" + list[i].orgName + "" + "" + list[i].code + "" + "" + list[i].business + "" + "" + list[i].cphone + "" + "" + list[i].type + "" + "" + list[i].adddate.split(' ')[0] + "" + ""; } $("#list").html(newH); } else { $("#list").html(''); $("#loadinfo").html("未查找到数据!"); } } }); }