Home >php教程 >PHP开发 >jquery ajax returns list in the background, and uses jquery to traverse the list in the front desk

jquery ajax returns list in the background, and uses jquery to traverse the list in the front desk

高洛峰
高洛峰Original
2016-12-08 13:52:341722browse

As shown below:

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


Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn