$(function (){ GetP2PProduct(""); $("#btnSearch").bind("click", function () { var keywords = $.trim($("#txtKeyword").val()).replace(/[<>&"]/g, function (c) { return { '<': '<', '>': '>', '&': '&', '"': '"', '"': '"', "'": '′', "'": '′' }[c]; }); if (keywords == "产品名称/所属平台") { keywords = ""; } GetP2PProduct(keywords) }); $("#txtKeyword").unbind("focus").focus(function () { $("#txtKeyword").val("").css("color","black"); }); }); function GetP2PProduct(keywords) { pageHelper.Init({ url: "/Student/P2PProducet/GetP2PProduceList", type: "POST", pageDiv: "#pages", data: { rId: Math.random(), keywords: keywords }, bind: function (data) { var html = ""; $(data.Data).each(function (index, dom) { //每行html var trHtml = ""; trHtml += ""; trHtml += "{0}"; trHtml += "{1}"; trHtml += "{2}"; trHtml += "{3}"; trHtml += "{4}"; trHtml += ""; //拼接tbody html += StringHelper.FormatStr(trHtml, dom.P2PName, dom.InvestmentField, dom.InvestmentCycle, dom.StartAmount, dom.EarningsRate ); }); $("#P2PProductList").html(html); } }); }