ajax请求已经从后台获取了json数据,现在想用mui.each()进行遍历,希望在html中显示,本人新手,希望能得到帮助,不胜感激!
目前不知道为啥只显示3条数据,其他的显示不出来 请大神指点指点
代码如下:
JS代码:
mui.init();
mui.plusReady(function(){
mui.ajax('http://127.0.0.1:666/tzmarket/home/test/getentry',{
dataType:'json',
type:'get',
timeout:100000,
success:function(data){
var list=document.getElementById("entrylist");
var finallist='';
mui.each(data,function(key,value){
finallist=finallist+'
'+''+
''+
'
''+
'
';})
list.innerHTML=finallist;
},
})
})
JSON数据如下:
{ "return_code": 0, "return_message": "成功", "data": [ { "type": 12, "title": "小图标1", "img_url": "http://127.0.0.1/CoEp_VknmxyAao.png" }, { "type": 9, "title": "小图标2", "img_url": "http:/127.0.0.1/CoEp_VknmuWAdX8eAAA.png" }, { "type": 1, "title": "小图标3", "img_url": "http://127.0.0.1/00/CoEp_Vknmy-y-c677.png" }, { "type": 5, "title": "小图标4", "img_url": "http://127.0.0.1/CoEp_FknmM3fZajTI735.png" } ] }