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.