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

时间:2016-10-30    点击:104   

如下所示:

$.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的实现全部内容了,希望大家多多支持本站~

vue.js学习笔记之绑定style样式和class列表
深入理解JavaScript中的块级作用域、私有变量与模块模式
jQuery grep()方法详解及实例代码
webix+springmvc session超时跳转登录页面
js获取时间函数及扩展函数的方法
> 返回     
地址:上海市普陀区胶州路941号长久商务中心 电话: QQ:
© Copyright 2012 上海网络 Product All Rights Reserved