Motivation: dynamic paging is used to facilitate users to view large volumes of data. Therefore, the paging function is the most widely used and most commonly used function module on the website. The previous pages of information are connected to the database, each time
Motivation: dynamic paging is used to facilitate users to view large volumes of data. Therefore, the paging function is the most widely used and most commonly used function module on the website. In the past, the paging information is connected to the database, and each click must be supported by the background database. This not only increases the server burden, but also seriously affects the user's browsing speed.
Imagine what would happen if we put the paging effect on the client? Look at the design below!
Materials:
Dynamic paging of XML volumes
There are two files: pages. xml and pages. xsl.
Purpose:
Put the paging effect on the client. Filter data without refreshing a new page, effectively improving the efficiency of data browsing.
Code:
Reference content is as follows:
Pages. xml
1
Sailflying
A simple paging
2002-1-11 17:35:33
XML topics
2
Flyingbird
Marry you. it hurts you.
2001-09-06 12:45:51
Essence of water injection
3
Accounts
Use of regular expressions in UBB forum
2001-11-23 21:02:16
Web Programming Essence
4
Taiyilang
End-of-year classic rudder gathering full manual v0.1
2000-12-08 10:22:48
Forum water injection zone
5
Mmkk
Asp error message summary
2001-10-13 16:39:05
Javascript script
Pages. xsl
Practical tips for XML volumes (3): Dynamic paging
Script
<br />var OnePageNum=2; <br />var PageNum=1; <br />var XMLPageNum=1; <br />function pages(Num) <br />{ <br />stylesheet=document.XSLDocument; <br />source=document.XMLDocument; <br />nodes=source.documentElement.childNodes; <br />len=nodes.length; <br />for(i=1;i<=(len/OnePageNum);i ); <br />XMLPageNum=i; <br />var firstNum=0; <br />var lastNume=0; </p> <p>if (Num=="first") {PageNum=1;} <br />if (Num=="previous") {if (PageNum>1) PageNum -=1;} <br />if (Num=="next") {if (PageNum<XMLPageNum) PageNum =1;} <br />if (Num=="last") {PageNum =XMLPageNum;} </p> <p>sortField=document.XSLDocument.selectSingleNode("//@expr"); <br />firstNum=OnePageNum*(PageNum-1) 1; <br />lastNum=OnePageNum*(PageNum-1) OnePageNum; <br />text="childnumber(this)>=" firstNum " & childnumber(this)<=" lastNum; <br />sortField.value=text; <br />Layer1.innerHTML=source.documentElement.transformNode(stylesheet); <br />} <br />
Script
Practical tips for XML volumes (3): Dynamic paging
Homepage Previous Page Next page Last page
|
| No. |
Name |
Topic |
Posting time |
Return class |