首页 >后端开发 >php教程 >PHP+AJAX分页,该如何解决

PHP+AJAX分页,该如何解决

WBOY
WBOY原创
2016-06-13 10:13:54802浏览

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