Home >Backend Development >PHP Tutorial >PHP+AJAX分页,该如何解决

PHP+AJAX分页,该如何解决

WBOY
WBOYOriginal
2016-06-13 10:13:54802browse

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",""); //鍒涘缓鏁版嵁搴撹繛鎺
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn