欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

基于jquery的無(wú)刷新分頁(yè)技術(shù)

 更新時(shí)間:2011年06月11日 00:34:52   作者:  
基于jquery的無(wú)刷新分頁(yè)技術(shù),需要的朋友可以參考下。
復(fù)制代碼 代碼如下:

<script src="script/jquery-1.6.1.min.js" type="text/javascript"></script>
<script type="text/javascript">
var index = 0;
$(document).ready(function () {
$.post("Default5.aspx", { name: index }, function (msg) {
$("tr:gt(0)").remove();
var artice = msg;
for (var i = 0; i < 5; i++) {
$("table").append("<tr><td>" + artice[i]["ID"] + "</td><td>" + artice[i]["Writer"] + "</td><td>" + artice[i]["Title"] + "</td></tr>");
}
}, "json");
});
$(document).ready(function () {
$("a").click(function () {
if ($(this).html() == "下一頁(yè)") {
index = index + 5;
if (index > 10) {
index = 10;
}
}
if ($(this).html() == "上一頁(yè)") {
index = index - 5;
if (index < 0) {
index = 0;
}
}
// alert(index);
$.post("Default5.aspx", { name: index }, function (msg) {
// alert(msg[0]["ID"]);
$("tr:gt(0)").remove();
var artice = msg;
for (var i = 0; i < 5; i++) {
// alert("11");
$("table").append("<tr><td>" + artice[i]["ID"] + "</td><td>" + artice[i]["Writer"] + "</td><td>" + artice[i]["Title"] + "</td></tr>");
// $("table").append("<tr><td>1</td><td>2</td><td>3</td></tr>");
}
}, "json");
});
});
</script>

相關(guān)文章

最新評(píng)論