Main ideas:
The key to implementing a paging query is to set the maximum number of data rows and the start line numbers for a page, with the following code:
Maximum number of rows we set it to constant, not to dwell on him, so the key is how to set the starting line number to a variable, and let him change as we click on "Previous Page" or "next page".
First look at the top-level code:
<script>function up () {var b= document.getElementById ("Hidd"); var a=B.value; A=parseint (a); if(a>=4) {a-=4 } Else{alert ("Now is the homepage")} B.value=A;} function down () {var e= document.getElementById ("Hidde"). Value; E=parseint (e); var b= document.getElementById ("Hidd"); var a=B.value; A=parseint (a); if(e!=0) {a+=4 } Else{alert ("Now is the last page"); } b.value=A;}</script>
When we click "Next Page", the onclick event is triggered, the starting line number is changed, and the form is submitted. After the form is submitted, pass the parameters to the following methods:
The method can return the starting line number we just changed.
The start line number is passed to the past by the method call of paged query, which realizes the refresh of the page.
Here is the illustration:
Complete paging query functionality with JavaScript