Use the Watercress API to get pagination results. Equivalent to the results obtained from the background database. The difference is that you can't know the number of pages in advance. Although the total number of pages can be obtained through the request API, because Ajax is asynchronous, it makes no sense to give a total number of pages at the beginning of a page. I used a fixed total of 65 pages (the total number of pages returned by searching for JavaScript books). So other books are not 65 pages, there will be multiple pages or fewer pages of the situation, this is not a bug.
Characteristics
1, the whole process does not need to contact the background, the front-end independent can (I have been looking for a long time did not find a complete example).
2, using Bootstrap's pagination to make page numbers and panel to make placement results.
The code is as follows
Reference
The logical processing part of the Http://bbs.csdn.net/topics/390734775?page=1 book uses the code here, but it is modified.
Effect Show
https://yuwanlin.github.io/general/%E5%88%86%E9%A1%B5/%E7%BB%93%E5%90%88%E8%B1%86%E7%93%A3%E6%90%9C%E7%B4%A2% E7%bb%93%e6%9e%9c%e8%bf%9b%e8%a1%8c%e5%88%86%e9%a1%b5.html