$.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) {} });
转载于:https://www.cnblogs.com/wangzhen/p/5773682.html