//遍历 o:index obj:json数据for(var o in obj){ var target = "#num_"+o; $(target).text(obj[o].count);}//ajax获取json并遍历$.ajax({ url: root+"getsafechild", type:"POST", data:{parentid:datatype}, success: function(data){ var childhtml = '
- 不限'; data = eval("("+data+")"); for(var o in data){ data[o]['parentid']; childhtml += '
- '+data[o]['safetype_name']+''; } childhtml += '