var datas=results.body.rows;
$(".roleListChose").empty();//每次追加前必须先清空
var checked=''
var trs="";
for(var i=0;i<datas.length;i++){
//trs +="<label><input name='role' type='radio' value='"+datas[i].platformRoleId+"'/>"+datas[i].platformRoleName+"</label>";
trs +="<label><input name='role' type='radio' value='"+datas[i].platformRoleId+"' "+(datas[i].platformRoleId == tplatformRoleId ? "checked='checked'" : "")+" />"+datas[i].platformRoleName+"</label>";
}
$('.roleListChose').append(trs);
return;
项目2
$.each(datas.datas, function(key, val) {
var tb_show = '<tr align="center"><td>' + (key+1) + '</td><td>' + val.serialNumber + '</td><td>' + val.channelName1 + '</td><td>' + val.channelName2 + '</td><td>' + val.channelName3 + '</td>
<td>' +(datas.datas[key].statusInfo==0?"正常":"SOS")+'</td><td>' + val.send_time + '</td><td>' + "定位" + '</td><td>' + val.lat + '</td><td>' + val.lng + '</td><td>' + val.username + '</td><td>' + val.phone + '</td><td>' + val.captainusername + '</td><td>' + val.content + '</td><td> <span>'+"回复消息"+'</span><span>'+"消息列表"+'</span> </td></tr>';
console.log(tb_show,898989)
$("#device_sosMessage tbody").append(tb_show)
});