jquery ajax后台返回list,前台用jquery遍历list的实现
(编辑:jimmy 日期: 2025/10/25 浏览:3 次 )
如下所示:
$.ajax({
type: 'post',
url: "maintain_findRoomByBuildingId.shtml",
cache: false,
data: {"buildingId":buildingId},
dataType: 'json',
success: function(data){
jQuery.each(data.roomList, function(i,item){
alert(item.id+","+item.name);
});
},
error: function(){
return;
}
});
以上就是小编为大家带来的jquery ajax后台返回list,前台用jquery遍历list的实现全部内容了,希望大家多多支持~
下一篇:浅谈JS函数定义方式的区别