如何在标记中对嵌套的JSON进行排序

时间:2015-06-11 14:54:55

标签: jquery html json sorting toggle

我正在构建一个巨大的嵌套json文件。在页面上,我希望能够根据一些嵌套元素进行排序。某些页面只显示某些巢,但我也希望能够在不同类别之间进行排序。

例如,我需要知道如何编写:全部显示,仅显示导线,仅显示GDes新,仅显示GDes旧等。有关如何在标记中创建简单切换的任何想法

[         {"电线":[             {"新":[                 {                 " url":" http://galnova.com/",                 "文件夹":" pro_images"                 },                 {                 " url":" http://galnova.com/",                 "文件夹":" pro_images"                 }             ]}         ]},

    {"GDes":[
        {"new":[
            {
            "url": "http://galnova.com/",
            "folder": "nu_images"
            },
            {
            "url": "http://galnova.com/",
            "folder": "nu_images"
            }
        ]}
    ]},

    {"GDes":[
        {"old":[
            {
            "url": "http://galnova.com/",
            "folder": "nu_images"
            },
            {
            "url": "http://galnova.com/",
            "folder": "nu_images"
            }
        ]}
    ]},

    {"Web":[
        {"new":[
            {
            "url": "http://galnova.com/",
            "folder": "nu_images"
            }
        ]}
    ]}
]

0 个答案:

没有答案