有json数据如何用JS的for循环生成这种表格 30
vardata=[{"grade":"一年级","team":[{"class":"一班","name":["小明","小红"]},{"class":"二班","name...
var data = [{"grade":"一年级","team":[{"class":"一班","name":["小明","小红"]},{"class":"二班","name":["小赵"]}]},{"grade":"二年级","team":[{"class":"一班","name":["小王"]},{"class":"二班","name":["小李","小张"]}]}]
展开
1个回答
展开全部
用angularJS,在页面用一个ng-repeat就可以了或者在action里返回对象A,A有get,set方法,例:privateAAA;publicStringexecute(){A=你的结果;return"success";},getA(),setA();在struts.xml中配置在页面是$.post("","",function(data,status){在这里直接去,例如:data.A(对象).id(属性);就可以得到对象A的id属性值。})
追问
不会就不要回,还从其他答案复制过来
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询