优德娱乐场w88手机版:一个值得你收藏的教程网站

最新下载

php ajax无刷新分页 支撑id定位的代码分享

时间:2018-05-07 15:24:53 编辑:猪哥 来源:转载

 0 )
? 
"优德娱乐场w88手机版n上一页n"
: 
"优德娱乐场w88手机版n上一页n";
for ( $i = 
$CurrentPage - $HalfPer,$i > 0 || $i = 0 ,     $j = 
$CurrentPage + $HalfPer, $j < $totalPage || $j = $totalPage;$i < $j ;$i++ 
)
{
  $re .= $i == $CurrentPage
  ? 
"[" . ( $i + 1 ) . 
"]n"
  : "" . ( $i + 1 ) . 
"n";
}
$re .= ( $CurrentPage < $total 
)
? "下一页n尾页n"
: 
"下一页n尾页n";
$re="$re
"; return $re; } //总页数,传递的页面变量-当前页 url地址 前后各多少页 $page = $_GET['page']; //echo page('10',$page,'index.php?page','2'); ?> <script type="text/javascript" language="javascript"> var http_request = false; function send_request(url,htmlid) { http_request = false; if (window.XMLHttpRequest) { http_request = new XMLHttpRequest(); if (http_request.overrideMimeType) { http_request.overrideMimeType('text/xml'); } } else if (window.ActiveXObject) { try { http_request = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try { http_request = new ActiveXObject("微软.XMLHTTP"); } catch (e) {} } } if (!http_request) { alert('不能创建 XMLHttpRequest 对象!'); return false; } http_request.onreadystatechange = function (){likeakak(htmlid);}//processRequest(htmlid) http_request.open('GET', url, true); http_request.send(null); } //处理返回信息 function processRequest(htmlid) { if (http_request.readyState == 1) { document.getElementById(htmlid).innerHTML="下载中..."; } if (http_request.readyState == 4) { if (http_request.status == 200) { document.getElementById(htmlid).innerHTML=http_request.responseText; } else { alert('请求异常'); } } } //处理返回信息 function likeakak(htmlid) { if (http_request.readyState == 1) { document.getElementById(htmlid).innerHTML="下载中..."; } if (http_request.readyState == 4) { if (http_request.status == 200) { document.getElementById(htmlid).innerHTML=http_request.responseText; } else { alert('请求异常'); } } } function ajaxaction(url,viewid) { send_request(url,viewid); } //自定义调用函数 function elist(id) { var inputarray = new Array(); inputarray[1] = 'aaa'; inputarray[2] = 'bbb'; inputarray[3] = 'ccc'; inputarray[4] = 'ddd'; inputarray[5] = 'eee'; send_request('ajax.php?do=ajax&sort='+id,inputarray[id]); } </script>

文章评论

热门栏目

XML 地图 | Sitemap 地图