ajax
$.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); } }, }); }