当前位置:编程学习 > php >>

ajax+php+mysql无刷新分页代码(1/2)

ajax+php教程+mysql教程无刷新分页代码

<!doctype html public "-//w3c//dtd html 4.01 transitional//en" "http://www.w3.org/tr/html4/loose.dtd">
  2  <html>
  3  <head>
  4     <title>投票结果</title>
  5     <meta http-equiv="content-type" content="text/html; charset=utf-8" />
  6
  7  <script type="text/网页特效">
  8
  9     function getxmlhttpobject()
 10 {
 11   var xmlhttp=null;
 12   try
 13     {
 14     // firefox, opera 8.0+, safari
 15      xmlhttp=new xmlhttprequest();
 16     }
 17   catch (e)
 18     {
 19     // internet explorer
 20     try
 21       {
 22       xmlhttp=new activexobject("msxml2.xmlhttp");
 23       }
 24     catch (e)
 25       {
 26       xmlhttp=new activexobject("microsoft.xmlhttp");
 27       }
 28     }
 29   return xmlhttp;
 30 }
 31 function checkajax(){
 32    xmlhttp=getxmlhttpobject()
 33  
 34   if (xmlhttp==null)
 35     {
 36     alert ("您的浏览器不支持ajax!");
 37     return ;
 38     }else
 39     {
 40        return xmlhttp;
 41     }
 42 }
 43 function preshow(){
 44     ajaxobj = checkajax();
 45     var url = "page.php?page=1";
 46 ajaxobj.onreadystatechange=statechanged;
 47 ajaxobj.open("get",url,true);
 48 ajaxobj.send(null);
 49 }
 50 function showhint1(str)
 51 {
 52     ajaxobj = checkajax();
 53     document.getelementbyid("msg").innerhtml="正在读取数据……";
 54
 55 var url = str;
 56 ajaxobj.onreadystatechange=statechanged;
 57 ajaxobj.open("get",url,true);
 58 ajaxobj.send(null);
 59
 60 }

1 2
补充:Php教程,Php高级应用 
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,