- 相關推薦
html無刷新分頁前端代碼
$(function () {
$.post("Test.ashx", { "action": "getpagecount" }, function (data, status) {
for (var i = 1; i <= data; i++) {
var td = $("<td><a href=''>" + i + "</a></td>");
$("#trpage").append(td);
}
$("#trpage td").click(function (e) {
e.preventDefault();
$.post("Test.ashx", { "action": "getpagedata", "pagenum": $(this).text() },
function (data, status)
{
var comments = $.parseJSON(data);
$("#ulorderlist").empty();
for (var i = 0; i < comments.length; i++) {
var comment = comments[i];
var li = $("<li>" + comment.OrderID + "--" + comment.OrderDate + "</li>");
$("#ulorderlist").append(li);
}
});
})
});
});
</script>
</head>
<body>
<ul id="ulorderlist">
</ul>
<table>
<tr id="trpage">
</tr>
</table>
</body>
</html>
【html無刷新分頁前端代碼】相關文章:
一段經典php mysql分頁程序代碼08-11
如何設置html字體10-03
php語言字典代碼06-08
語義化的HTML結構好處07-23
html元素水平居中的方法06-24
html語言中URL的用法06-20
上海考研報考點及代碼09-28
簡單的計算器代碼09-25
php動態生成JavaScript代碼10-03
Bios錯誤代碼介紹10-14