js遍历list
//传入id
var id = $("#id").val();
$.ajax({
type: 'post',
url: base + 'getAllTime',
cache: false,
data: {
id:id
},
dataType: 'json',
success : function(list) {
var s="";
for(var i=0;i<list.length;i++){
var time = list[i].time;
var id = list[i].id;
$("#time").val(time);
s+=time;
s+=",";
}
$("#div1").html(s);
}})
//页面显示
<a id="div1"></a>