apicloud实现分页加载数据 作者:马育民 • 2017-12-03 01:07 • 阅读:10165 html页面 ```html 继续加载 ``` js代码 ```javascript apiready = function(){ show(); }; var limit=3;//每次查询的记录数 var skip=0;//跳过的记录数 function showArticleList(){ var client = new Resource(APP_INFO.app_id, APP_INFO.app_key); var Model = client.Factory("article"); Model.query({ "filter":{ "fields":{"id": true, "title": true, "viewNum": true,"creatorName": true},//或者["id","make","model"] "where":{ "status":1, //"title":{"like":"马.*"} },//status列的记录是1的,全部查询 "order": "viewNum DESC", "skip":skip, "limit":limit } }, function(ret,err){ if(err){ //处理错误 err }else{ //处理数据 ret alert(JSON.stringify(ret)); var interation = doT.template( $('#articleTemp').html() ); //将数据显示到网页中 $( '#content' ).append(interation( ret )); } }) } function show(){ showArticleList(); skip=skip+limit;//每次查询后都增加跳过的记录数 } ``` 原文出处:http://www.malaoshi.top/show_1EFAW4mYAMm.html