Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How Ajax reads data and displays it in pages

2025-01-26 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

This article will explain in detail how Ajax reads the data and displays it in pages. The editor thinks it is very practical, so I share it for you as a reference. I hope you can get something after reading this article.

I think it is still necessary to present my ajax page to you. I will first talk about the implementation core of this ajax page, and then we will look at the example effect. The so-called ajax page and the traditional data page, the code on the server side is basically the same. What we mainly do is to use ajax to change the requested page number without refreshing it. And the number of pages to be displayed to be sent to the server. Click on this URL to see the data you want to request: "ajax_page.asp?action=read&pagecount=3 & current_page=1"

In this URL, pagecount represents how many pieces of data to display on each page, and current_page represents the page number to be solicited. The server sends back the data you want to request according to these two parameters.

This is the front-end ajax code:

The copy code is as follows:

Ajax data paging

Body {

Font-size:12px

}

Table {

Border-collapse:collapse

}

Li {

List-style:none

Border:1px solid

Width:20px

Height:20px

Text-align:center

Margin:5px

Padding:2px

Float:left

Cursor:pointer

}

The default display is 5 pieces of data per page. You can set the number of entries per page in the text box below.

Enter the number of entries to display per page:

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 222

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report