首頁 >後端開發 >php教程 > PHP+AJAX分页,该如何解决

PHP+AJAX分页,该如何解决

WBOY
WBOY原創
2016-06-13 13:42:14784瀏覽

PHP+AJAX分页




 
<script> <br />function viewpage(p){ <br />if(window.XMLHttpRequest){ <br />var xmlReq = new XMLHttpRequest(); <br />} else if(window.ActiveXObject) { <br />var xmlReq = new ActiveXObject('Microsoft.XMLHTTP'); <br />} <br />var formData = "page="+p; <br />xmlReq.onreadystatechange = function(){ <br />if(xmlReq.readyState == 4){ <br />document.getElementById('content2').innerHTML = xmlReq.responseText; <br />} <br />} <br />xmlReq.open("post", "d.php", true); <br />xmlReq.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); <br />xmlReq.send(formData); <br />return false; <br />} <br /></script> 
#header("Content-Type:text/html;charset=GB2312"); 
$pagesize=10; 
//echo $_POST['page']; 
$db=mysql_connect("localhost","root",""); //鍒涘缓鏁版嵁搴撹繛鎺
陳述:
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn