分享web开发知识

注册/登录|最近发布|今日推荐

主页 IT知识网页技术软件开发前端开发代码编程运营维护技术分享教程案例
当前位置:首页 > 教程案例

ajax

发布时间:2023-09-06 01:57责任编辑:董明明关键词:暂无标签
$.ajax({type : ‘POST‘,url ?: ‘/plus/list.php‘,data : {‘pageNum‘: page -1,‘act‘ : ‘ajax_page‘,‘tid‘: ‘9‘},dataType : ‘json‘,beforeSend : function(){$(".more").html("加载中...");},success:function(data){console.log(data)total = data.total; //总记录数 ?pageSize = data.pageSize;//每页显示条数 ?curPage = page;//当前页 ?totalPage = data.totalPage;//总页数var html = "";var list = data.list;if(!list) {$(".more").html("未添加数据~~~");return ‘‘;}$.each(list, function(key,val){var num = page*key + 1 ;num = num * 0.2; html += ‘<li class="wow fadeInUp animated" data-wow-delay="‘+num+‘s" data-wow-duration="500ms">‘;html += ‘<a href="‘+val.arcurl+‘">‘;html += ‘<div class="new_infor_img">‘;html += ‘<img class="scales" src="‘+val.litpic+‘">‘; html += ‘</div>‘;html += ‘<p class="new_infor_classify">‘+val.source+‘</p>‘;html += ‘<p class="new_infor_title">‘+val.title+‘</p>‘;html += ‘<p class="new_infor_details">‘+val.description+‘</p>‘;html += ‘</a>‘;html += ‘</li>‘;});$(".list_uld ").append(html); ?$(".more").html("点击查看更多");isbool=true; ???//如果是最后页 if( curPage >= totalPage ){ ?$(".more").html("已经没有数据了");$(".more").attr("page", ‘0‘)} else{var next = parseInt($(".more").attr("page")) + 1;$(".more").attr("page", next);} },});}

  

ajax

原文地址:https://www.cnblogs.com/Abner3721/p/9110414.html

知识推荐

我的编程学习网——分享web前端后端开发技术知识。 垃圾信息处理邮箱 tousu563@163.com 网站地图
icp备案号 闽ICP备2023006418号-8 不良信息举报平台 互联网安全管理备案 Copyright 2023 www.wodecom.cn All Rights Reserved