当前位置:主页 > 网页前端 > jquery >

jquery ajax后台返回list,前台用jquery遍历list的实现

时间:2021-04-17 09:52:41 | 栏目:jquery | 点击:

如下所示:

$.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;  
    }  
  }); 

您可能感兴趣的文章:

相关文章