ajax+php+mysql无刷新分页代码 ajax+php教程+mysql教程无刷新分页代码 2 3 4 投票结果 5 6 7 <br /> 8 <br /> 9 function getxmlhttpobject()<br /> 10 {<br /> 11 var xmlhttp=null;<br /> 12 try<br /> 13 {<br /> 14 // firefox, opera 8.0+, safari<br /> 15 xmlhttp=new xmlhttprequest();<br /> 16 }<br /> 17 catch (e)<br /> 18 {<br /> 19 // internet explorer<br /> 20 try<br /> 21 {<br /> 22 xmlhttp=new activexobject("msxml2.xmlhttp");<br /> 23 }<br /> 24 catch (e)<br /> 25 {<br /> 26 xmlhttp=new activexobject("microsoft.xmlhttp");<br /> 27 }<br /> 28 }<br /> 29 return xmlhttp;<br /> 30 }<br /> 31 function checkajax(){<br /> 32 xmlhttp=getxmlhttpobject()<br /> 33 <br /> 34 if (xmlhttp==null)<br /> 35 {<br /> 36 alert ("您的浏览器不支持ajax!");<br /> 37 return ;<br /> 38 }else<br /> 39 {<br /> 40 return xmlhttp;<br /> 41 }<br /> 42 }<br /> 43 function preshow(){<br /> 44 ajaxobj = checkajax();<br /> 45 var url = "page.php?page=1";<br /> 46 ajaxobj.onreadystatechange=statechanged;<br /> 47 ajaxobj.open("get",url,true);<br /> 48 ajaxobj.send(null);<br /> 49 }<br /> 50 function showhint1(str)<br /> 51 {<br /> 52 ajaxobj = checkajax();<br /> 53 document.getelementbyid("msg").innerhtml="正在读取数据……";<br /> 54 <br /> 55 var url = str;<br /> 56 ajaxobj.onreadystatechange=statechanged;<br /> 57 ajaxobj.open("get",url,true);<br /> 58 ajaxobj.send(null);<br /> 59 <br /> 60 }<br /> 1 2