<div class="codetitle"> <span><a style="CURSOR: pointer" data="17239" class="copybut" id="copybut17239" onclick="doCopy('code17239')"><u>复制代码</u></a></span> 代码如下:</div> <div class="codebody" id="code17239"> <br><script src="script/jquery-1.6.1.min.js" type="text/javascript"></script> <br><script type="text/javascript"> <BR>var index = 0; <BR>$(document).ready(function () { <BR>$.post("Default5.aspx", { name: index }, function (msg) { <BR>$("tr:gt(0)").remove(); <BR>var artice = msg; <BR>for (var i = 0; i < 5; i++) { <BR>$("table").append("<tr><td>" + artice[i]["ID"] + "<td>" + artice[i]["Writer"] + "<td>" + artice[i]["Title"] + ""); <BR>} <BR>}, "json"); <BR>}); <BR>$(document).ready(function () { <BR>$("a").click(function () { <BR>if ($(this).html() == "下一页") { <BR>index = index + 5; <BR>if (index > 10) { <BR>index = 10; <BR>} <BR>} <BR>if ($(this).html() == "上一页") { <BR>index = index - 5; <BR>if (index < 0) { <BR>index = 0; <BR>} <BR>} <BR>// alert(index); <BR>$.post("Default5.aspx", { name: index }, function (msg) { <BR>// alert(msg[0]["ID"]); <BR>$("tr:gt(0)").remove(); <BR>var artice = msg; <BR>for (var i = 0; i < 5; i++) { <BR>// alert("11"); <BR>$("table").append("<tr><td>" + artice[i]["ID"] + "<td>" + artice[i]["Writer"] + "<td>" + artice[i]["Title"] + ""); <BR>// $("table").append("<tr><td>1<td>2<td>3"); <BR>} <BR>}, "json"); <BR>}); <BR>}); <BR></script> <br> </div>