Jquery implements the html page div. The principle of false paging is code. jquerydiv
Principle of div false paging: After filling, the total height of the div (PX) shows the height (PX), then the total number of pages is 10 pages. When you view the second page, the height of the displayed div is between 100 and 200, and so on.
When the page is displayed, the div scroll bar is moved.
<Div id = "applications"> display data set </div>
<Style> # applications {/* width: 500px; adjust the display area width */height: 1592px;/* adjust the display area height */font-size: 14px; margin-top: 23px; line-height: 20px; overflow-pageindex: hidden; overflow-y: hidden; word-break: break-all;} </style>
<Script language = "javascript"> var obj = document. getElementById ("applications"); // obtain the content layer var pages = document. getElementById ("pages"); // obtain the page flip window. onload = function () // rewrite the event loaded by the form {var allpages = Math. ceil (parseInt (obj. scrollHeight)/parseInt (obj. offsetHeight); // obtain the page quantity // pages. innerHTML = "<B> total" + allpages-1 + "page </B>"; // number of output pages for (var I = 1; I <= allpages; I ++) {if (I = 1) {pages. innerHTML + = "<a href = \" javascript: showPage ('"+ I +"'); \ "> homepage </a>" ;}else {pages. innerHTML + = "<a href = \" javascript: showPage ('"+ I +"'); \ ">" + I + "</a> ";} // loop output page} function showPage (pageINdex) {obj. scrollTop = (pageINdex-1) * parseInt (obj. offsetHeight); // outputs the specified Page Based on the height.} </script>
When dynamic data is paged, the number of records on the last page is insufficient and the specific height must be filled. Otherwise, the data on the previous page is displayed on the last page repeatedly.
How can I use jquery to query html pages by page?
This is actually true.
<Div id = "perpage" style = "float: left;">
<Select onchange = "sorter. size (this. value)">
<Option value = "5"> 5 </option>
<Option value = "10" selected = "selected"> 10 </option>
<Option value = "20"> 20 </option>
</Select>
<Span> Entries Per Page </span>
</Div>
<Div id = "navigation" style = "float: left; margin-left: 200px;">
<A href = "javascript: void (0)" onclick = "sorter. move (-1, true) "style =" margin-left: 8px; "> homepage </a>
<A href = "javascript: void (0)" onclick = "sorter. move (-1)" style = "margin-left: 8px;"> previous page </a>
<A href = "javascript: void (0)" onclick = "sorter. move (1)" style = "margin-left: 8px;"> next page </a>
<A href = "javascript: void (0)" onclick = "sorter. move (1, true) "style =" margin-left: 8px; "> last page </a>
</Div>
<Div id = "text" style = "float: left; margin-left: 20px;">
<Span id = "currentpage"> </span>/<span id = "pagelimit"> </span> </div>
</Div>
</Div>
Below is the JS part, put it before the end (</body>) ...... the remaining full text>
After jquery dynamically changes the page, the code in the original html page also changes and is saved.
This cannot be done! Because js cannot save files !!!
One way is to use cookies !, However, cookies are small, with a maximum of 4 kb.
There are two solutions.
1. html5 provides offline data storage. However, ie6, ie7, and ie8 do not support HTML5!
2. Use ajajx to submit data directly to the database! This is suitable for any browser!
There are only two solutions!
-----------------
Ask a question. ^ _*