时间:2021-07-01 10:21:17 帮助过:4人阅读
ajax分页
$pages?$pages:($start+5-1);
$end = $end>$pages?$pages:$end;
$start = ($end-5+1)<1?1:$end-5+1;
$link = '';
for($i=$start;$i<=$end;$i++) {
if($i == $page) {
$link .= $i;
continue;
}
$link .= ' ' . $i . ' ';
}
echo $link;
window.onload = function ()
{
check(1);
}
function check(node) {
var parameter = "page=" + node;
var nokia = ajax();
//alert(nokia);return;
nokia.open('POST',"process.php",true);
nokia.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
nokia.send(parameter);
nokia.onreadystatechange = function () {
if(nokia.readyState==4 && nokia.status==200) {
document.getElementById('span1').innerHTML = this.responseText;
}
}
}
------解决方案--------------------