html中的input
<input type="button" value="首页" id="first" /> <input type="button" value="上一页"id="up" /><input type=button value="下一页"id="down" /><input type="button" value="尾页" id="end"/> <span>共几页</span> 第
<input type="text" id="val" value=""/>页 <input type="button" value="GO" id="go"/>
JQ代码:
$(function () {
$("#go").click(function () {
var count = document.getElementById("val").value; alert(count);
$.get("pageMain.ashx", { "isFirst": "No", "coutPage": count, "total": totalpage }, function (date, status) {
if (date == "已经是第一页") {
alert("没有该页");
}
else {
$("table tr th").parent().siblings().remove();
var tb = document.getElementById("tb");
var trs = date.split("|");
for (var i = 0; i < trs.length - 1; i++) {
var tr = tb.insertRow(-1);
var tds = trs.split(",");
for (var j = 0; j < tds.length; j++) {
var td = tr.insertCell(-1);
td.innerText = tds[j];
}
}
}
})
});
})
效果:
|