将ajax获取到的JSON对象遍历输出求助
vardata=[{"id":"31","title":"注意事项","thumb":"a.gif","type":"暂无","url":"1.html","catnam...
var data = [{"id":"31","title":"注意事项","thumb":"a.gif","type":"暂无","url":"1.html","catname":"资讯","updatetime":"2017-01-11 14:15:06"},{"id":"32","title":"快捷方法","thumb":"b.jpg","type":"暂无","url":"7.html","catname":"资讯","updatetime":"2016-12-14 10:38:20"}];
我希望将data对象遍历并输出HTML中id为txt的容器中,并输出格式为(对应对象中个属性名和值)
<li><a href="url">catname - title <time>updatetime</time></li>
..... 展开
我希望将data对象遍历并输出HTML中id为txt的容器中,并输出格式为(对应对象中个属性名和值)
<li><a href="url">catname - title <time>updatetime</time></li>
..... 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询