What is the principle of javascript paging?

Source: Internet
Author: User
What is the principle of paging with javascript? How can I interact with php at the backend?

Reply content:

What is the principle of paging with javascript? How can I interact with the backend php?

1. You can send the page number of the current page and the number of records per page as parameters to the backend. the backend then returns the corresponding data, and the front-end displays the corresponding data.
2. Directly query all the data in the database and store the data in global variables. You can only display the corresponding data based on the page number and number of records (this is not recommended)

Not allSelect... from table where... limit (offset, pageNum). WhereOffset = pageindex * pageNum

According to your question, it means to useAjaxAsynchronous.

Front end:
AddPageParameter,PageThe parameter returns the requested page number to the backend.

Backend:
The backend transmitsPageYou only need to return the specified data to the front-end.

The page number is also requested.

Two parameters are uploaded at the front end.PageSize(Number of entries per page)SkipCount(The number of entries skipped, And the frontend is accumulating), and the backend queries accordingly.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.