jquery 上滑加载分页

手机版推荐插件(http://jqweui.com/extends)
需要引用文件
{load href="/static/shop/css/dropload.css" /}
{load href="/static/shop/js/jquery.min.js" /}
{load href="/static/shop/js/dropload.min.js" /}

<div id="loadmore" style="display:none;text-align: center;color: #a0a0a0;">&nbsp;</div>

//请求加载
// dropload调用
$('#loadmore').dropload({
scrollArea : window,
loadDownFn : function(me){
page++;
// 拼接HTML
var result = '';
$.ajax({
type:"post",
dataType:"json",
data:{page:page,currency_id:currency_id},
url:"{:url('User/entrustedRecord')}",
success:function(data){
var arrLen = data.length;
if(data.code == 1 && data.data != ''){
$.each(data.data,function(i,item){
                    s = '<span style="color:blue">已撤销</span>';
y = '';
x = '';
                            result +=
"<tr><th>编号:"+item.orders_id+"</th>" +
"<th>"+item.add_time+"</th>";
result +=
"<tr><th>挂单数:"+item.num+"</th>" +
"<th>价格:"+item.price+"</th>"+
"<th>"+s+"</th>";
result +=
"<tr><th>成交数:"+item.trade_num+"</th>" +
"<th>"+item.trade_time+"</th>"+
"<th "+y+">"+x+"</th>";
result +=
"<tr><th style='border-bottom:1px solid #ddd; width:100%;height:1px;'></th><th style='border-bottom:1px solid #ddd; width:100%;height:1px;'></th><th style='border-bottom:1px solid #ddd; width:100%;height:1px;'></th></tr>";
});
}else{
// 如果没有数据
$("#no_sj").show();
// 锁定
me.lock();
// 无数据
me.noData();
}
// 为了测试,延迟1秒加载
setTimeout(function(){
// 插入数据到页面,放到最后面
$('#wtrecord').append(result);
// 每次数据插入,必须重置
me.resetload();
},1000);
},
error: function(xhr, type){
alert('网络错误,请稍后重试!');
// 即使加载出错,也得重置
me.resetload();
}
});

}
});

转载于:https://www.cnblogs.com/nonoleng/p/8655545.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值