Get the App
SLTechnology News&Howtos  ›  Development  › 

How to realize the effect of Ajax paging

Shulou Source: shulou.com Published: 2022-06-03 05:38:37 11月17日 Update

This article is about how to achieve the effect of Ajax paging. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.

First create the foreground page MyAjaxPager.aspx

The copy code is as follows:

.a {} {height:20px; line-height:20px; border-bottom:1px solid # d8dfea; clear:both;}

.b {} {float:left; width:30px;}

.c {} {float:left; width:500px;}

Var xmlHttp

Function getData (pIndex) {

XmlHttp = GetXmlRequest ()

XmlHttp.onreadystatechange = ShowRepeaterData

XmlHttp.open ("GET", "AjaxProcess.aspx?index=" + pIndex, true)

XmlHttp.send (null)

}

Function ShowRepeaterData () {

If (xmlHttp.readyState = = 4 & & xmlHttp.status = = 200) {

Var gridData = xmlHttp.responseText

Var grid = document.getElementById ("grid")

Grid [XSS _ clean] = gridData

}

}

one

two

three

four

five

fifty

five hundred

5000

50000

99999

Serial number

Name

The screen is very simple, it is a row of index addresses, and when you click the link, the data will be bound to the repeater below in the form of ajax.

The main functions are implemented on AjaxProcess.aspx pages that handle Ajax requests

Thank you for reading! This is the end of the article on "how to achieve the effect of Ajax paging". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, you can share it for more people to see!

Tags: Effect code content more article page good practical foreground function address name that is data article way is in screen look knowledge Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Microsoft macOS Linux Shulou Tech Info MySQL