ajax 收到后台返回来的list值,显示undefined
$.ajax({type:"get",url:"showCompanyInfor.do",dataType:"json",data:{name:"sph"},succes...
$.ajax({
type:"get",
url:"showCompanyInfor.do",
dataType:"json",
data:{
name:"sph"
},
success:function(data){
data=eval(data);
$.each(data, function (i, item) {
alert(item.COMPANY_NAME);
});
alert(data[0].COMPANY_NAME);//返回list
alert(data[0].COMPANY_WEB);
alert(data[0].company_type);
//alert(data.length);
/*for(var i=0;i<data.length;i++){
$("#companyinfor").after(
"<tr>"+
"<td><input type='checkbox' name='IDCheck' value='14458579642011' class='acb' /></td>"+
"<td>"+data[i].zzjgdm+"</td>"+
"<td>"+data[i].company_name+"</td>"+
"<td>"+data[i].company_web+"</td>"+
"<td>"+data[i].nstype+"</td>"+
"<td>"+data[i].zczj+"</td>"+
"<td>"+data[i].company_type+"</td>"+
"<td>"+data[i].phone+"</td>"+
"<td>"+data[i].email+"</td>"+
"<td><a href='house_edit.html?fyID=14458579642011'"+
"class='edit'>编辑</a> <a href='javascript:del('14458579642011');'>删除</a>"+
"</td>"+
"</tr>"
);
}*/
},
error:function(){
alert("4444");
}
}); 展开
type:"get",
url:"showCompanyInfor.do",
dataType:"json",
data:{
name:"sph"
},
success:function(data){
data=eval(data);
$.each(data, function (i, item) {
alert(item.COMPANY_NAME);
});
alert(data[0].COMPANY_NAME);//返回list
alert(data[0].COMPANY_WEB);
alert(data[0].company_type);
//alert(data.length);
/*for(var i=0;i<data.length;i++){
$("#companyinfor").after(
"<tr>"+
"<td><input type='checkbox' name='IDCheck' value='14458579642011' class='acb' /></td>"+
"<td>"+data[i].zzjgdm+"</td>"+
"<td>"+data[i].company_name+"</td>"+
"<td>"+data[i].company_web+"</td>"+
"<td>"+data[i].nstype+"</td>"+
"<td>"+data[i].zczj+"</td>"+
"<td>"+data[i].company_type+"</td>"+
"<td>"+data[i].phone+"</td>"+
"<td>"+data[i].email+"</td>"+
"<td><a href='house_edit.html?fyID=14458579642011'"+
"class='edit'>编辑</a> <a href='javascript:del('14458579642011');'>删除</a>"+
"</td>"+
"</tr>"
);
}*/
},
error:function(){
alert("4444");
}
}); 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询