When creating a project, you must use ajax without refreshing pages. You can give up the idea because you are not very familiar with the pagerhealkaline class. Think of the pages previously written using SQL stored procedures, so I want to use javascript and Jquery to write a paging program. Below I will only write the paging function, jquery's ajax request is omitted. 1 function Pagers (page)
2 {
3 var div = document. createElement ("div ");
4 div. id = "bar ";
5 document. getElementById ("pager"). appendChild (div );
6 var j = (page-3 <1 )? 1: page-3;
7 var k = (page + 3> maxpage )? Maxpage: page + 3;
8 if (j> 1)
9 {
10 var a = document. createElement ("");
11 a. href = "#";
12 a. innerHTML = "";
13 document. getElementById ("bar"). appendChild ();
14}
15 for (var I = j; I <k + 1; I ++)
16 {
17 if (I! = K)
18 {
19 var a = document. createElement ("");
20 var s = I;
21 a. href = "javascript: reloadpager (); Pagers (" + I + ");";
22 a. innerHTML = I;
23 document. getElementById ("bar"). appendChild ();
24 continue;
25}
26 if (maxpage> k)
27 {
28 var a = document. createElement ("");
29 a. href = "#";
30 a. innerHTML = "";
31 document. getElementById ("bar"). appendChild ();
32 var a = document. createElement ("");
33 a. href = "#";
34 a. onclick = "reloadpager (); Pagers (" + maxpage + ");";
35 a. innerHTML = maxpage;
36 document. getElementById ("bar"). appendChild ();
37}
38}
39
40}
41 function reloadpager ()
42 {
43 var pp = document. getElementById ("bar ");
44 document. getElementById ("pager"). removeChild (pp );
45}
It may be helpful to everyone!