apicloud根据id进行查询 作者:马育民 • 2017-09-27 14:13 • 阅读:10160 ```html 标题 内容 作者 浏览量 ``` ```javascript var articleId; apiready = function(){ //从前一个页面中查询出id articleId=api.pageParam.id; showById(); }; //根据id查询article的详细记录 function showById(){ var client = new Resource("appId", "appKey"); var Model = client.Factory("article"); Model.get({"_id":articleId}, function(ret,err){ if(err){ //处理错误 err }else{ //处理数据 ret //将数据显示到页面中 $("#title").html(ret.title); $("#content").html(ret.content); $("#author").html(ret.creatorName); $("#viewNum").html(ret.viewNum); } }) } ``` 原文出处:http://www.malaoshi.top/show_1C744o9tyJ4.html