laypage front-end paging plug-in implements ajax asynchronous paging
layPage is a multifunctional js paging component. It is suitable for asynchronous paging and traditional full page refresh. It also supports information flow loading and can be seamlessly migrated to the Node.js platform. This article The article mainly introduces the laypage front-end paging plug-in to implement ajax asynchronous paging. Friends who need it can refer to the following
The example of this article shares the laypage front-end paging plug-in, ajax asynchronous paging, and obtains json data to implement non-refresh paging. For your reference, the specific content is as follows
function GetList(pageIndex) { var _this = "" var clone_this = ""; _this = $(".BindDataList");//数据列表容器, clone_this = _this.clone(true); var pageSize = 25;//每页展示的条数 $.ajax({ type: "get", async: false,//异步锁定,默认为true url: "../ashx/System/DefaultAjax.ashx",//后端处理数据,返回json格式 data: {"pageIndex": pageIndex, "pageSize": pageSize, }, contentType: "application/json; charset=utf-8", success: function (data) { var json = eval("(" + data + ")"); if (json.PageCount > 0) //数据总条数 { _this.html(""); for (var i = 0; i < json.rows.length ; i++) { var html = "<li>json数据</li>"; _this.append(html); } jsonpage(json, pageIndex, pageSize); } else { _this.html(""); _this.append(""); } } }); } function jsonpage(json, pageIndex, pageSize) { var coun = json.PageCount;//总数据条数 var pagecount = coun % pageSize == 0 ? coun / pageSize : coun / pageSize + 1;//计算多少页 var laypageindex = laypage({ cont: 'project_page', //容器。值支持id名、原生dom对象,jquery对象。 skin: '#fb771f', pages: pagecount, //通过后台拿到的总页数 curr: pageIndex, //初始化当前页 first: '|<', //将首页显示为数字1,。若不显示,设置false即可 last: '>|', //将尾页显示为总页数。若不显示,设置false即可 prev: '<', //若不显示,设置false即可 next: '>', //若不显示,设置false即可 jump: function (obj, first) { //触发分页后的回调 if (!first) { //点击跳页触发函数自身,并传递当前页:obj.curr SearchHotTag(obj.curr); } } }); }
The above is what I compiled for everyone. I hope it will be helpful to everyone in the future.
Related articles:
Ajax method of sending and receiving binary byte stream data
The perfect solution to the problem of Session failure during ajax access Question
Using Ajax technology to partially refresh product quantity and total price Example code
The above is the detailed content of laypage front-end paging plug-in implements ajax asynchronous paging. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

PyCharm is a powerful and popular Python integrated development environment (IDE) that provides a wealth of functions and tools so that developers can write code more efficiently. The plug-in mechanism of PyCharm is a powerful tool for extending its functions. By installing different plug-ins, various functions and customized features can be added to PyCharm. Therefore, it is crucial for newbies to PyCharm to understand and be proficient in installing plug-ins. This article will give you a detailed introduction to the complete installation of PyCharm plug-in.

How to implement dual WeChat login on Huawei mobile phones? With the rise of social media, WeChat has become one of the indispensable communication tools in people's daily lives. However, many people may encounter a problem: logging into multiple WeChat accounts at the same time on the same mobile phone. For Huawei mobile phone users, it is not difficult to achieve dual WeChat login. This article will introduce how to achieve dual WeChat login on Huawei mobile phones. First of all, the EMUI system that comes with Huawei mobile phones provides a very convenient function - dual application opening. Through the application dual opening function, users can simultaneously

When users use the Edge browser, they may add some plug-ins to meet more of their needs. But when adding a plug-in, it shows that this plug-in is not supported. How to solve this problem? Today, the editor will share with you three solutions. Come and try it. Method 1: Try using another browser. Method 2: The Flash Player on the browser may be out of date or missing, causing the plug-in to be unsupported. You can download the latest version from the official website. Method 3: Press the "Ctrl+Shift+Delete" keys at the same time. Click "Clear Data" and reopen the browser.

What is the Chrome plug-in extension installation directory? Under normal circumstances, the default installation directory of Chrome plug-in extensions is as follows: 1. The default installation directory location of chrome plug-ins in windowsxp: C:\DocumentsandSettings\username\LocalSettings\ApplicationData\Google\Chrome\UserData\Default\Extensions2. chrome in windows7 The default installation directory location of the plug-in: C:\Users\username\AppData\Local\Google\Chrome\User

The programming language PHP is a powerful tool for web development, capable of supporting a variety of different programming logics and algorithms. Among them, implementing the Fibonacci sequence is a common and classic programming problem. In this article, we will introduce how to use the PHP programming language to implement the Fibonacci sequence, and attach specific code examples. The Fibonacci sequence is a mathematical sequence defined as follows: the first and second elements of the sequence are 1, and starting from the third element, the value of each element is equal to the sum of the previous two elements. The first few elements of the sequence

How to implement the WeChat clone function on Huawei mobile phones With the popularity of social software and people's increasing emphasis on privacy and security, the WeChat clone function has gradually become the focus of people's attention. The WeChat clone function can help users log in to multiple WeChat accounts on the same mobile phone at the same time, making it easier to manage and use. It is not difficult to implement the WeChat clone function on Huawei mobile phones. You only need to follow the following steps. Step 1: Make sure that the mobile phone system version and WeChat version meet the requirements. First, make sure that your Huawei mobile phone system version has been updated to the latest version, as well as the WeChat App.

Does PyCharm Community Edition support enough plugins? Need specific code examples As the Python language becomes more and more widely used in the field of software development, PyCharm, as a professional Python integrated development environment (IDE), is favored by developers. PyCharm is divided into two versions: professional version and community version. The community version is provided for free, but its plug-in support is limited compared to the professional version. So the question is, does PyCharm Community Edition support enough plug-ins? This article will use specific code examples to

In today's software development field, Golang (Go language), as an efficient, concise and highly concurrency programming language, is increasingly favored by developers. Its rich standard library and efficient concurrency features make it a high-profile choice in the field of game development. This article will explore how to use Golang for game development and demonstrate its powerful possibilities through specific code examples. 1. Golang’s advantages in game development. As a statically typed language, Golang is used in building large-scale game systems.
