Pat*_*ick 10 arrays jquery json
我正在使用一些类似于的Json:
{
"Apps" : [
{
"Name" : "app1",
"id" : "1",
"groups" : [
{ "id" : "1", "name" : "test group 1", "desc" : "this is a test group" },
{ "id" : "2", "name" : "test group 2", "desc" : "this is another test group" }
]
}
]
}
Run Code Online (Sandbox Code Playgroud)
如果我在jquery中解析它以返回一个对象,我正在遍历应用程序,如下所示:
$.each(myJsonObject.Apps, function() { ... };
Run Code Online (Sandbox Code Playgroud)
我怎样才能得到它的长度this.groups
?
我试过了
我找不到任何关于具有良好信息的多层json对象的文档.
任何链接或示例或建议将不胜感激.
mat*_*ven 19
尝试:
$.each(myJsonObject.Apps, function(i, obj) { ... });
obj.Groups.length;
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
92184 次 |
最近记录: |