Home  >  Article  >  Web Front-end  >  How to implement website pagination_html/css_WEB-ITnose

How to implement website pagination_html/css_WEB-ITnose

WBOY
WBOYOriginal
2016-06-24 12:04:27982browse

I am new to HTML5 and can already write pages (hard-written content). If I want to implement the functions of previous page and next page like a normal blog, do I need to associate it with the database or use some method? Is it possible?


Reply to the discussion (solution)

Ajax or anything else can be implemented, you just need the total number of items, the number of items displayed on each page, and the starting line. Several parameters, so you query the database twice, once to check the actual number of items, and once to check the total number of items.

The front-end can use the jquery pagination plug-in. The server-side depends on what database and language program are used, and there are corresponding paging methods.

The general approach is to request data asynchronously and pass each The number of entries displayed on the page and the current page. Then the corresponding number of entries is read from the database, returned using json data format, and then processed in the foreground.

The front-end can use the jquery pagination plug-in. The server side depends on what database and language program are used, and there are corresponding paging methods.


This plug-in is developed related to HTML5 What? Why does it feel like java development? I'm a beginner and don't understand much.

The general approach is to request data asynchronously, pass the number of entries displayed on each page in the past and the current page, then read the corresponding number of entries from the database, return it using json data format, and then Front desk processing.


html5 ajax (written in a js file), the data format is JSON, but in what file are the sql statements written? I checked online and asked for ASP or PHP. Is that so?

Ajax or anything else can be implemented. You just need the total number of items, the number of items displayed on each page, and the starting row. So you query the database twice and query the actual items once. Count, check the total number of items at one time.


I would like to ask where the sql statement is written? Or are there any posts or resources I can check out?

In fact, the conditions are just a few parameters. It does not have to be connected to the database. The set array can also be paged. The key is how you process it, that is, what language you use to process it.

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn