ajax绑定

function Select() {
var data = $("#SelectByTime").serialize();
$.post(
"settle.aspx?action=Select",
data,
function (ajaxResult) {
if (ajaxResult[2].Value == "True") {
if (ajaxResult[0].Value == "") {
$("#eOrderTbody").html("");
}
else {

$("#eOrderTbody").html($("#tmpl").tmpl(JSON.parse(ajaxResult[0].Value)));
}
}
else {
alert(ajaxResult[0].Value);
if (ajaxResult[1].Value == "Login") {
window.location = "/Web/user/UserLogin.aspx";
}
$("#eOrderTbody").html("");
}
}, "json"
);
};

</script>
<script type="text/x-jquery-tmpl" id="tmpl">
<tr>
<td>${eOrderNumber}</td>
<td>${eUserName}</td>
<td>${eOrderTotalWeight}</td>
<td>${totalPrice}</td>
</tr>
</script>

posted @ 2015-07-21 14:09  .netCore初学者  阅读(235)  评论(0编辑  收藏  举报