The ajax-based method for refreshing pagination and ajax-based method for refreshing pagination

Source: Internet
Author: User

The ajax-based method for refreshing pagination and ajax-based method for refreshing pagination

The example in this article describes how to implement non-refreshing pagination Based On ajax. Share it with you for your reference. The details are as follows:

In normal pages, once the page number changes, the url changes and the whole page is refreshed. If we want the page number to change without affecting the whole page, we can use ajax technology.

AJAX is a technology used to create fast dynamic web pages. By performing a small amount of data exchange with the server in the background, AJAX can implement asynchronous updates on webpages. This means that you can update a part of a webpage without reloading the entire webpage.

Use the client's html code and ajax to pass the server's data through the get method and display it in html.

<! Doctype html> 

In the paging class, we only need to change the hyperlink address and change the original address to the f1 () method called by js to pass the link to the f1 () method in js.

<a href='javascript:f1(\"{$this->uri}&page=".($this->page+1)."\")'>

Furthermore, you can use json to implement pagination with no refreshing effects. Compared with ajax, json writes html and css on the client, which saves the server bandwidth and speeds up user requests, the specific method is not described in detail.

I hope this article will help you with Ajax programming.

Related Article

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.