如何用$.each()遍历json

如何用$.each()遍历json,具体语法是什么

绿野仙踪yy
浏览 1787回答 2
2回答

侠客岛的含笑

var json = [    {"id":"1","tagName":"apple"},    {"id":"2","tagName":"orange"},    {"id":"3","tagName":"banana"},    {"id":"4","tagName":"watermelon"},    {"id":"5","tagName":"pineapple"}];$.each(json, function(idx, obj) {    alert(obj.tagName);});

绿野仙踪yy

谢谢!
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

JavaScript