jquery ajax 返回list的处理

84483065 2012-08-09

var url = "<%=request.getContextPath()%>/XXX.action";

var param = {'XXX':3};

$.post(url,param,function (result){

var dataObj=eval(result);//转换为数组对象 

$.each( dataObj, function(i, n){           //遍历数组 

  var content = "<tr><td>"+n.aa+"</td></tr>";

  $("#div1").append(content);

});

},"json");

相关推荐