JSCP sample - local pagination

click here to show first page
Comment

In-browser rendering give us more power than traditional web developing. In this some bigger sample, we see that page count doesn't need to be equal to request count. All data got in only two requests, but we show them in 10 pages. Once you get first part, you can see any content of page 1-5 without sending more request, once second part, you can see any content of page 6-10 without sending more request. We put javascript code into seperate app.js file, define a MyPaginationData class, and LocalPaginationApp to comminuate with server, get pure data, like what we do in Client-Server programming before.
If the data are very large that we can not hold all of them, we may write a cache module to cooperate, it goes beyond of our demo.
Read this sample's HTML source and file "app.js" for full details.

NOTE

Template files and return data should be UTF-8 encoding, if they contain non-ASCII characters.