这是我的javascript加载更多内容,只使用填充gridview的存储过程显示接下来的10条记录
<script>
var prev = 0;
function Loadmore() {
//get last Order Id to track next fetch
var OrderIdLast = $("#tblOrders1 tr:last").children("td:first").html();
//get last table row in order to append the new result set increment
var trLast = $("#tblOrders1 tr:last");
if (parseInt(OrderIdLast, 10) > parseInt(prev, 10)) {
prev = OrderIdLast;
//make a async call to fetch the incremental results
$.post("Handler5.ashx?lastOrderId=" + OrderIdLast, function (data) {
if (data != null) {
//append new result set to last row
trLast.after(data);
}
});
}
}
</script>
<input type="button" value="Load" onclick="Loadmore()" runat="server"/>
但是当我第二次重新输入输入时,它无法加载下一组数据
我做错了什么?