下边是两种前台接收并遍历list
$.ajax({
type: 'post',
url: xxx.action',
dataType: 'text',
success: function(data){
var dataObj=eval("("+data+")");
for(var i=0;i<dataObj.length;i++){
alert(dataObj[i].id+" "+dataObj[i].name);
}
var jsonObj=eval("("+data+")");
$.each(jsonObj, function (i, item) {
alert(item.id + "," + item.name);
});
},
error: function(text) {}
});