Ajax + php + mysql refreshing paging code
Ajax + php tutorial + mysql tutorial without refreshing paging code
<! Doctype html public "-// w3c // dtd html 4.01 transitional // en" "http://www.w3.org/tr/html4/loose.dtd">
2 3 4 <title> voting result </title>
5 <meta http-equiv = "content-type" content = "text/html; charset = UTF-8"/>
6
7 <script type = "text/Webpage effects">
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 ("your browser does not support 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 = "reading data ...... ";
54
55 var url = str;
56 ajaxobj. onreadystatechange = statechanged;
57 ajaxobj. open ("get", url, true );
58 ajaxobj. send (null );
59
60}
1 2