循环遍历

$.ajax({
type: "POST",
url: '',
dataType:'json',
cache: false,
success: function(data){
var timespac_id = Number($("#timespac_id").val());
console.log(data)
data.forEach(function(item,index){
if(timespac_id == item.timespac_id){
$("#jc_name").val(item.timespac_name);
}
})
},
error:function() {

}

});
posted @ 2018-09-21 16:56  萝卜快跑  阅读(108)  评论(0编辑  收藏  举报