author:咔咔
wechat:fangkangfk
这里放一个组装数据的案例,不会的可以参考一下
$.ajax({
type:"post",
url:"{url(Banner/index)}",//对应controller的URL
async:false,
dataType: 'json',
data:{
"page_index":page,
"page_size":limit,
},
success:function(ret){
total=ret.total;
var data1=ret.data;
var html= '';
for(var i=0;i
html+='
';html+='
'+ data1[i].b_id +'';html+='
'+ data1[i]['banner_type']['vt_name'] +'';html+='
'+ data1[i]['banner_vs_video_name']['vi_title'] +'';html+='
'+ data1[i]['b_thumbnailUrl'] +'';html+='
'+ data1[i]['b_linkUrl'] +'';html+='
'+ data1[i]['b_sort'] +'';html+='
'+ data1[i]['b_showType'] +'';html+='
'+ data1[i]['b_targetType'] +'';html+='
'+ data1[i]['b_title'] +'';html+='
'+ data1[i]['b_slaveTitle'] +'';html+='
'+ data1[i]['b_linkUrlList']+'';html+='
';html+='编辑';
html+='删除';
html+='
';html+='
';}
$("#tab_list").html(html);
}
});