导航JSON对象

时间:2017-12-29 14:48:19

标签: javascript jquery json

我一直在努力寻找解决方案,但一切都没有出现。由于限制,必须从专有服务器提供给我的JSON对象构建移动导航系统。他们允许使用jQuery 1.12.4,但是不能使用其他框架,甚至不能使用更新的jQuery 3.无法加载PHP,Python或任何其他语言。所以必须找到纯javascript或jQuery 1.12.4解决方案。

将有可变数量的菜单项和可变数量的子菜单项。我知道您可以通过括号表示法 进行访问(不能使用点表示法,因为密钥在服务器中包含点) 但是如何使用变量或建立它循环。

示例我正在尝试获取内部对象L.3.170,但需要可变地构建括号引用。并从字符串中制作“后退”功能。

从字符串“L.1.171~L.2.170”构建以下REF,初始是在波形符号上拆分并从循环构建REF但是没有找到关于如何执行该操作的任何示例。我发现了一些eval,但它们似乎没有用。

建造REF:OBJ.root ['L.1.171'] ['L.2.170']

要构建的子菜单:OBJ.root ['L.1.171'] ['L.2.170'] ['L.3.170']

用可变的括号替换文字括号,子菜单的深度可变。

所有“L”键名都是唯一的,所以是否有某种查找功能(如数组)?什么都没有出现或正在研究如何在JSON中找到一个子对象。

来自服务器的JSON(OBJ):

{
    "root": {
        "SubCount": 4,
        "L.1.22": {
            "img": "",
            "CategoryID": 635,
            "SubCount": 4,
            "L.2.4": {
                "img": "",
                "CategoryID": 692,
                "SubCount": 1,
                "L.3.4": { "img": "", "CategoryID": 229, "SubCount": 0 }
            },
            "L.2.10": {
                "img": "",
                "CategoryID": 213,
                "SubCount": 5,
                "L.3.6": { "img": "", "CategoryID": 46, "SubCount": 0 },
                "L.3.7": { "img": "", "CategoryID": 48, "SubCount": 0 },
                "L.3.8": { "img": "", "CategoryID": 49, "SubCount": 0 },
                "L.3.9": { "img": "", "CategoryID": 50, "SubCount": 0 },
                "L.3.10": { "img": "", "CategoryID": 95, "SubCount": 0 }
            },
            "L.2.14": {
                "img": "",
                "CategoryID": 212,
                "SubCount": 3,
                "L.3.12": { "img": "", "CategoryID": 53, "SubCount": 0 },
                "L.3.13": { "img": "", "CategoryID": 55, "SubCount": 0 },
                "L.3.14": { "img": "", "CategoryID": 98, "SubCount": 0 }
            },
            "L.2.22": {
                "img": "",
                "CategoryID": 211,
                "SubCount": 7,
                "L.3.16": { "img": "", "CategoryID": 46, "SubCount": 0 },
                "L.3.17": { "img": "", "CategoryID": 49, "SubCount": 0 },
                "L.3.18": { "img": "", "CategoryID": 50, "SubCount": 0 },
                "L.3.19": { "img": "", "CategoryID": 52, "SubCount": 0 },
                "L.3.20": { "img": "", "CategoryID": 54, "SubCount": 0 },
                "L.3.21": { "img": "", "CategoryID": 95, "SubCount": 0 },
                "L.3.22": { "img": "", "CategoryID": 98, "SubCount": 0 }
            }
        },
        "L.1.100": {
            "img": "",
            "CategoryID": 689,
            "SubCount": 6,
            "L.2.38": {
                "img": "",
                "CategoryID": 225,
                "SubCount": 14,
                "L.3.25": { "img": "", "CategoryID": 612, "SubCount": 0 },
                "L.3.26": { "img": "", "CategoryID": 773, "SubCount": 0 },
                "L.3.27": { "img": "", "CategoryID": 1174, "SubCount": 0 },
                "L.3.28": { "img": "", "CategoryID": 135, "SubCount": 0 },
                "L.3.29": { "img": "", "CategoryID": 451, "SubCount": 0 },
                "L.3.30": { "img": "", "CategoryID": 1169, "SubCount": 0 },
                "L.3.31": { "img": "", "CategoryID": 403, "SubCount": 0 },
                "L.3.32": { "img": "", "CategoryID": 136, "SubCount": 0 },
                "L.3.33": { "img": "", "CategoryID": 133, "SubCount": 0 },
                "L.3.34": { "img": "", "CategoryID": 134, "SubCount": 0 },
                "L.3.35": { "img": "", "CategoryID": 138, "SubCount": 0 },
                "L.3.36": { "img": "", "CategoryID": 137, "SubCount": 0 },
                "L.3.37": { "img": "", "CategoryID": 132, "SubCount": 0 },
                "L.3.38": { "img": "", "CategoryID": 130, "SubCount": 0 }
            },
            "L.2.53": {
                "img": "",
                "CategoryID": 217,
                "SubCount": 14,
                "L.3.40": { "img": "", "CategoryID": 108, "SubCount": 0 },
                "L.3.41": { "img": "", "CategoryID": 611, "SubCount": 0 },
                "L.3.42": { "img": "", "CategoryID": 772, "SubCount": 0 },
                "L.3.43": { "img": "", "CategoryID": 448, "SubCount": 0 },
                "L.3.44": { "img": "", "CategoryID": 103, "SubCount": 0 },
                "L.3.45": { "img": "", "CategoryID": 404, "SubCount": 0 },
                "L.3.46": { "img": "", "CategoryID": 106, "SubCount": 0 },
                "L.3.47": { "img": "", "CategoryID": 105, "SubCount": 0 },
                "L.3.48": { "img": "", "CategoryID": 107, "SubCount": 0 },
                "L.3.49": { "img": "", "CategoryID": 104, "SubCount": 0 },
                "L.3.50": { "img": "", "CategoryID": 266, "SubCount": 0 },
                "L.3.51": { "img": "", "CategoryID": 1168, "SubCount": 0 },
                "L.3.52": { "img": "", "CategoryID": 1173, "SubCount": 0 },
                "L.3.53": { "img": "", "CategoryID": 112, "SubCount": 0 }
            },
            "L.2.68": {
                "img": "",
                "CategoryID": 219,
                "SubCount": 14,
                "L.3.55": { "img": "", "CategoryID": 613, "SubCount": 0 },
                "L.3.56": { "img": "", "CategoryID": 775, "SubCount": 0 },
                "L.3.57": { "img": "", "CategoryID": 450, "SubCount": 0 },
                "L.3.58": { "img": "", "CategoryID": 144, "SubCount": 0 },
                "L.3.59": { "img": "", "CategoryID": 146, "SubCount": 0 },
                "L.3.60": { "img": "", "CategoryID": 400, "SubCount": 0 },
                "L.3.61": { "img": "", "CategoryID": 145, "SubCount": 0 },
                "L.3.62": { "img": "", "CategoryID": 151, "SubCount": 0 },
                "L.3.63": { "img": "", "CategoryID": 150, "SubCount": 0 },
                "L.3.64": { "img": "", "CategoryID": 147, "SubCount": 0 },
                "L.3.65": { "img": "", "CategoryID": 1170, "SubCount": 0 },
                "L.3.66": { "img": "", "CategoryID": 1176, "SubCount": 0 },
                "L.3.67": { "img": "", "CategoryID": 143, "SubCount": 0 },
                "L.3.68": { "img": "", "CategoryID": 141, "SubCount": 0 }
            },
            "L.2.83": {
                "img": "",
                "CategoryID": 220,
                "SubCount": 14,
                "L.3.70": { "img": "", "CategoryID": 614, "SubCount": 0 },
                "L.3.71": { "img": "", "CategoryID": 774, "SubCount": 0 },
                "L.3.72": { "img": "", "CategoryID": 1171, "SubCount": 0 },
                "L.3.73": { "img": "", "CategoryID": 1175, "SubCount": 0 },
                "L.3.74": { "img": "", "CategoryID": 453, "SubCount": 0 },
                "L.3.75": { "img": "", "CategoryID": 153, "SubCount": 0 },
                "L.3.76": { "img": "", "CategoryID": 399, "SubCount": 0 },
                "L.3.77": { "img": "", "CategoryID": 154, "SubCount": 0 },
                "L.3.78": { "img": "", "CategoryID": 155, "SubCount": 0 },
                "L.3.79": { "img": "", "CategoryID": 161, "SubCount": 0 },
                "L.3.80": { "img": "", "CategoryID": 160, "SubCount": 0 },
                "L.3.81": { "img": "", "CategoryID": 156, "SubCount": 0 },
                "L.3.82": { "img": "", "CategoryID": 159, "SubCount": 0 },
                "L.3.83": { "img": "", "CategoryID": 158, "SubCount": 0 }
            },
            "L.2.98": {
                "img": "",
                "CategoryID": 698,
                "SubCount": 14,
                "L.3.85": { "img": "", "CategoryID": 776, "SubCount": 0 },
                "L.3.86": { "img": "", "CategoryID": 1167, "SubCount": 0 },
                "L.3.87": { "img": "", "CategoryID": 253, "SubCount": 0 },
                "L.3.88": { "img": "", "CategoryID": 608, "SubCount": 0 },
                "L.3.89": { "img": "", "CategoryID": 473, "SubCount": 0 },
                "L.3.90": { "img": "", "CategoryID": 256, "SubCount": 0 },
                "L.3.91": { "img": "", "CategoryID": 258, "SubCount": 0 },
                "L.3.92": { "img": "", "CategoryID": 259, "SubCount": 0 },
                "L.3.93": { "img": "", "CategoryID": 260, "SubCount": 0 },
                "L.3.94": { "img": "", "CategoryID": 254, "SubCount": 0 },
                "L.3.95": { "img": "", "CategoryID": 255, "SubCount": 0 },
                "L.3.96": { "img": "", "CategoryID": 262, "SubCount": 0 },
                "L.3.97": { "img": "", "CategoryID": 1172, "SubCount": 0 },
                "L.3.98": { "img": "", "CategoryID": 397, "SubCount": 0 }
            },
            "L.2.100": {
                "img": "",
                "CategoryID": 218,
                "SubCount": 1,
                "L.3.100": { "img": "", "CategoryID": 208, "SubCount": 0 }
            }
        },
        "L.1.122": {
            "img": "",
            "CategoryID": 870,
            "SubCount": 6,
            "L.2.108": {
                "img": "", "CategoryID": 871, "SubCount": 6,
                "L.3.103": { "img": "", "CategoryID": 883, "SubCount": 0 },
                "L.3.104": { "img": "", "CategoryID": 885, "SubCount": 0 },
                "L.3.105": { "img": "", "CategoryID": 873, "SubCount": 0 },
                "L.3.106": { "img": "", "CategoryID": 886, "SubCount": 0 },
                "L.3.107": { "img": "", "CategoryID": 872, "SubCount": 0 },
                "L.3.108": { "img": "", "CategoryID": 884, "SubCount": 0 }
            },
            "L.2.109": { "img": "", "CategoryID": 886, "SubCount": 0 },
            "L.2.110": { "img": "", "CategoryID": 872, "SubCount": 0 },
            "L.2.111": { "img": "", "CategoryID": 884, "SubCount": 0 },
            "L.2.112": { "img": "", "CategoryID": 876, "SubCount": 0 },
            "L.2.122": {
                "img": "",
                "CategoryID": 672,
                "SubCount": 9,
                "L.3.114": { "img": "", "CategoryID": 839, "SubCount": 0 },
                "L.3.115": { "img": "", "CategoryID": 210, "SubCount": 0 },
                "L.3.116": { "img": "", "CategoryID": 277, "SubCount": 0 },
                "L.3.117": { "img": "", "CategoryID": 639, "SubCount": 0 },
                "L.3.118": { "img": "", "CategoryID": 870, "SubCount": 0 },
                "L.3.119": { "img": "", "CategoryID": 282, "SubCount": 0 },
                "L.3.120": { "img": "", "CategoryID": 1191, "SubCount": 0 },
                "L.3.121": { "img": "", "CategoryID": 932, "SubCount": 0 },
                "L.3.122": { "img": "", "CategoryID": 332, "SubCount": 0 }
            }
        },
        "L.1.171": {
            "img": "",
            "CategoryID": 672,
            "SubCount": 9,
            "L.2.124": { "img": "", "CategoryID": 839, "SubCount": 0 },
            "L.2.125": { "img": "", "CategoryID": 210, "SubCount": 0 },
            "L.2.132": {
                "img": "",
                "CategoryID": 277,
                "SubCount": 6,
                "L.3.127": { "img": "1173128.Chat Icon.png", "CategoryID": 1211, "SubCount": 0 },
                "L.3.128": { "img": "", "CategoryID": 1159, "SubCount": 0 },
                "L.3.129": { "img": "", "CategoryID": 1084, "SubCount": 0 },
                "L.3.130": { "img": "", "CategoryID": 1150, "SubCount": 0 },
                "L.3.131": { "img": "", "CategoryID": 1138, "SubCount": 0 },
                "L.3.132": { "img": "", "CategoryID": 1119, "SubCount": 0 }
            },
            "L.2.145": {
                "img": "",
                "CategoryID": 639,
                "SubCount": 12,
                "L.3.134": { "img": "", "CategoryID": 122, "SubCount": 0 },
                "L.3.135": { "img": "", "CategoryID": 121, "SubCount": 0 },
                "L.3.136": { "img": "", "CategoryID": 512, "SubCount": 0 },
                "L.3.137": { "img": "", "CategoryID": 124, "SubCount": 0 },
                "L.3.138": { "img": "", "CategoryID": 125, "SubCount": 0 },
                "L.3.139": { "img": "", "CategoryID": 127, "SubCount": 0 },
                "L.3.140": { "img": "", "CategoryID": 878, "SubCount": 0 },
                "L.3.141": { "img": "", "CategoryID": 877, "SubCount": 0 },
                "L.3.142": { "img": "", "CategoryID": 880, "SubCount": 0 },
                "L.3.143": { "img": "", "CategoryID": 879, "SubCount": 0 },
                "L.3.144": { "img": "", "CategoryID": 874, "SubCount": 0 },
                "L.3.145": { "img": "", "CategoryID": 282, "SubCount": 0 }
            },
            "L.2.152": {
                "img": "",
                "CategoryID": 870,
                "SubCount": 6,
                "L.3.147": { "img": "", "CategoryID": 871, "SubCount": 0 },
                "L.3.148": { "img": "", "CategoryID": 886, "SubCount": 0 },
                "L.3.149": { "img": "", "CategoryID": 872, "SubCount": 0 },
                "L.3.150": { "img": "", "CategoryID": 884, "SubCount": 0 },
                "L.3.151": { "img": "", "CategoryID": 876, "SubCount": 0 },
                "L.3.152": { "img": "", "CategoryID": 672, "SubCount": 0 }
            },
            "L.2.158": {
                "img": "",
                "CategoryID": 282,
                "SubCount": 5,
                "L.3.154": { "img": "", "CategoryID": 122, "SubCount": 0 },
                "L.3.155": { "img": "", "CategoryID": 512, "SubCount": 0 },
                "L.3.156": { "img": "", "CategoryID": 121, "SubCount": 0 },
                "L.3.157": { "img": "", "CategoryID": 124, "SubCount": 0 },
                "L.3.158": { "img": "", "CategoryID": 127, "SubCount": 0 }
            },
            "L.2.165": {
                "img": "",
                "CategoryID": 1191,
                "SubCount": 6,
                "L.3.160": { "img": "", "CategoryID": 1184, "SubCount": 0 },
                "L.3.161": { "img": "", "CategoryID": 1186, "SubCount": 0 },
                "L.3.162": { "img": "", "CategoryID": 1185, "SubCount": 0 },
                "L.3.163": { "img": "", "CategoryID": 1187, "SubCount": 0 },
                "L.3.164": { "img": "", "CategoryID": 1189, "SubCount": 0 },
                "L.3.165": { "img": "", "CategoryID": 1190, "SubCount": 0 }
            },
            "L.2.170": {
                "img": "",
                "CategoryID": 932,
                "SubCount": 4,
                "L.3.167": { "img": "", "CategoryID": 936, "SubCount": 0 },
                "L.3.168": { "img": "", "CategoryID": 1181, "SubCount": 0 },
                "L.3.169": { "img": "", "CategoryID": 331, "SubCount": 0 },
                "L.3.170": { "img": "", "CategoryID": 1182, "SubCount": 0 }
            },
            "L.2.171": { "img": "", "CategoryID": 332, "SubCount": 0 }
        }
    }
}

2 个答案:

答案 0 :(得分:1)

如果您最终明确了解自己的想法,我认为您可能会得到更好的答案。我会尝试填写一些我认为你正在寻找的东西。

如果您有一个像"L.1.171~L.2.170"这样的字符串,您可以简单地拆分和缩小以获得具有以下内容的对象:



var OBJ = { "root": { "SubCount": 4, "L.1.22": { "img": "", "CategoryID": 635, "SubCount": 4, "L.2.4": { "img": "", "CategoryID": 692, "SubCount": 1, "L.3.4": { "img": "", "CategoryID": 229, "SubCount": 0 } }, "L.2.10": { "img": "", "CategoryID": 213, "SubCount": 5, "L.3.6": { "img": "", "CategoryID": 46, "SubCount": 0 }, "L.3.7": { "img": "", "CategoryID": 48, "SubCount": 0 }, "L.3.8": { "img": "", "CategoryID": 49, "SubCount": 0 }, "L.3.9": { "img": "", "CategoryID": 50, "SubCount": 0 }, "L.3.10": { "img": "", "CategoryID": 95, "SubCount": 0 } }, "L.2.14": { "img": "", "CategoryID": 212, "SubCount": 3, "L.3.12": { "img": "", "CategoryID": 53, "SubCount": 0 }, "L.3.13": { "img": "", "CategoryID": 55, "SubCount": 0 }, "L.3.14": { "img": "", "CategoryID": 98, "SubCount": 0 } }, "L.2.22": { "img": "", "CategoryID": 211, "SubCount": 7, "L.3.16": { "img": "", "CategoryID": 46, "SubCount": 0 }, "L.3.17": { "img": "", "CategoryID": 49, "SubCount": 0 }, "L.3.18": { "img": "", "CategoryID": 50, "SubCount": 0 }, "L.3.19": { "img": "", "CategoryID": 52, "SubCount": 0 }, "L.3.20": { "img": "", "CategoryID": 54, "SubCount": 0 }, "L.3.21": { "img": "", "CategoryID": 95, "SubCount": 0 }, "L.3.22": { "img": "", "CategoryID": 98, "SubCount": 0 } } }, "L.1.100": { "img": "", "CategoryID": 689, "SubCount": 6, "L.2.38": { "img": "", "CategoryID": 225, "SubCount": 14, "L.3.25": { "img": "", "CategoryID": 612, "SubCount": 0 }, "L.3.26": { "img": "", "CategoryID": 773, "SubCount": 0 }, "L.3.27": { "img": "", "CategoryID": 1174, "SubCount": 0 }, "L.3.28": { "img": "", "CategoryID": 135, "SubCount": 0 }, "L.3.29": { "img": "", "CategoryID": 451, "SubCount": 0 }, "L.3.30": { "img": "", "CategoryID": 1169, "SubCount": 0 }, "L.3.31": { "img": "", "CategoryID": 403, "SubCount": 0 }, "L.3.32": { "img": "", "CategoryID": 136, "SubCount": 0 }, "L.3.33": { "img": "", "CategoryID": 133, "SubCount": 0 }, "L.3.34": { "img": "", "CategoryID": 134, "SubCount": 0 }, "L.3.35": { "img": "", "CategoryID": 138, "SubCount": 0 }, "L.3.36": { "img": "", "CategoryID": 137, "SubCount": 0 }, "L.3.37": { "img": "", "CategoryID": 132, "SubCount": 0 }, "L.3.38": { "img": "", "CategoryID": 130, "SubCount": 0 } }, "L.2.53": { "img": "", "CategoryID": 217, "SubCount": 14, "L.3.40": { "img": "", "CategoryID": 108, "SubCount": 0 }, "L.3.41": { "img": "", "CategoryID": 611, "SubCount": 0 }, "L.3.42": { "img": "", "CategoryID": 772, "SubCount": 0 }, "L.3.43": { "img": "", "CategoryID": 448, "SubCount": 0 }, "L.3.44": { "img": "", "CategoryID": 103, "SubCount": 0 }, "L.3.45": { "img": "", "CategoryID": 404, "SubCount": 0 }, "L.3.46": { "img": "", "CategoryID": 106, "SubCount": 0 }, "L.3.47": { "img": "", "CategoryID": 105, "SubCount": 0 }, "L.3.48": { "img": "", "CategoryID": 107, "SubCount": 0 }, "L.3.49": { "img": "", "CategoryID": 104, "SubCount": 0 }, "L.3.50": { "img": "", "CategoryID": 266, "SubCount": 0 }, "L.3.51": { "img": "", "CategoryID": 1168, "SubCount": 0 }, "L.3.52": { "img": "", "CategoryID": 1173, "SubCount": 0 }, "L.3.53": { "img": "", "CategoryID": 112, "SubCount": 0 } }, "L.2.68": { "img": "", "CategoryID": 219, "SubCount": 14, "L.3.55": { "img": "", "CategoryID": 613, "SubCount": 0 }, "L.3.56": { "img": "", "CategoryID": 775, "SubCount": 0 }, "L.3.57": { "img": "", "CategoryID": 450, "SubCount": 0 }, "L.3.58": { "img": "", "CategoryID": 144, "SubCount": 0 }, "L.3.59": { "img": "", "CategoryID": 146, "SubCount": 0 }, "L.3.60": { "img": "", "CategoryID": 400, "SubCount": 0 }, "L.3.61": { "img": "", "CategoryID": 145, "SubCount": 0 }, "L.3.62": { "img": "", "CategoryID": 151, "SubCount": 0 }, "L.3.63": { "img": "", "CategoryID": 150, "SubCount": 0 }, "L.3.64": { "img": "", "CategoryID": 147, "SubCount": 0 }, "L.3.65": { "img": "", "CategoryID": 1170, "SubCount": 0 }, "L.3.66": { "img": "", "CategoryID": 1176, "SubCount": 0 }, "L.3.67": { "img": "", "CategoryID": 143, "SubCount": 0 }, "L.3.68": { "img": "", "CategoryID": 141, "SubCount": 0 } }, "L.2.83": { "img": "", "CategoryID": 220, "SubCount": 14, "L.3.70": { "img": "", "CategoryID": 614, "SubCount": 0 }, "L.3.71": { "img": "", "CategoryID": 774, "SubCount": 0 }, "L.3.72": { "img": "", "CategoryID": 1171, "SubCount": 0 }, "L.3.73": { "img": "", "CategoryID": 1175, "SubCount": 0 }, "L.3.74": { "img": "", "CategoryID": 453, "SubCount": 0 }, "L.3.75": { "img": "", "CategoryID": 153, "SubCount": 0 }, "L.3.76": { "img": "", "CategoryID": 399, "SubCount": 0 }, "L.3.77": { "img": "", "CategoryID": 154, "SubCount": 0 }, "L.3.78": { "img": "", "CategoryID": 155, "SubCount": 0 }, "L.3.79": { "img": "", "CategoryID": 161, "SubCount": 0 }, "L.3.80": { "img": "", "CategoryID": 160, "SubCount": 0 }, "L.3.81": { "img": "", "CategoryID": 156, "SubCount": 0 }, "L.3.82": { "img": "", "CategoryID": 159, "SubCount": 0 }, "L.3.83": { "img": "", "CategoryID": 158, "SubCount": 0 } }, "L.2.98": { "img": "", "CategoryID": 698, "SubCount": 14, "L.3.85": { "img": "", "CategoryID": 776, "SubCount": 0 }, "L.3.86": { "img": "", "CategoryID": 1167, "SubCount": 0 }, "L.3.87": { "img": "", "CategoryID": 253, "SubCount": 0 }, "L.3.88": { "img": "", "CategoryID": 608, "SubCount": 0 }, "L.3.89": { "img": "", "CategoryID": 473, "SubCount": 0 }, "L.3.90": { "img": "", "CategoryID": 256, "SubCount": 0 }, "L.3.91": { "img": "", "CategoryID": 258, "SubCount": 0 }, "L.3.92": { "img": "", "CategoryID": 259, "SubCount": 0 }, "L.3.93": { "img": "", "CategoryID": 260, "SubCount": 0 }, "L.3.94": { "img": "", "CategoryID": 254, "SubCount": 0 }, "L.3.95": { "img": "", "CategoryID": 255, "SubCount": 0 }, "L.3.96": { "img": "", "CategoryID": 262, "SubCount": 0 }, "L.3.97": { "img": "", "CategoryID": 1172, "SubCount": 0 }, "L.3.98": { "img": "", "CategoryID": 397, "SubCount": 0 } }, "L.2.100": { "img": "", "CategoryID": 218, "SubCount": 1, "L.3.100": { "img": "", "CategoryID": 208, "SubCount": 0 } } }, "L.1.122": { "img": "", "CategoryID": 870, "SubCount": 6, "L.2.108": { "img": "", "CategoryID": 871, "SubCount": 6, "L.3.103": { "img": "", "CategoryID": 883, "SubCount": 0 }, "L.3.104": { "img": "", "CategoryID": 885, "SubCount": 0 }, "L.3.105": { "img": "", "CategoryID": 873, "SubCount": 0 }, "L.3.106": { "img": "", "CategoryID": 886, "SubCount": 0 }, "L.3.107": { "img": "", "CategoryID": 872, "SubCount": 0 }, "L.3.108": { "img": "", "CategoryID": 884, "SubCount": 0 } }, "L.2.109": { "img": "", "CategoryID": 886, "SubCount": 0 }, "L.2.110": { "img": "", "CategoryID": 872, "SubCount": 0 }, "L.2.111": { "img": "", "CategoryID": 884, "SubCount": 0 }, "L.2.112": { "img": "", "CategoryID": 876, "SubCount": 0 }, "L.2.122": { "img": "", "CategoryID": 672, "SubCount": 9, "L.3.114": { "img": "", "CategoryID": 839, "SubCount": 0 }, "L.3.115": { "img": "", "CategoryID": 210, "SubCount": 0 }, "L.3.116": { "img": "", "CategoryID": 277, "SubCount": 0 }, "L.3.117": { "img": "", "CategoryID": 639, "SubCount": 0 }, "L.3.118": { "img": "", "CategoryID": 870, "SubCount": 0 }, "L.3.119": { "img": "", "CategoryID": 282, "SubCount": 0 }, "L.3.120": { "img": "", "CategoryID": 1191, "SubCount": 0 }, "L.3.121": { "img": "", "CategoryID": 932, "SubCount": 0 }, "L.3.122": { "img": "", "CategoryID": 332, "SubCount": 0 } } }, "L.1.171": { "img": "", "CategoryID": 672, "SubCount": 9, "L.2.124": { "img": "", "CategoryID": 839, "SubCount": 0 }, "L.2.125": { "img": "", "CategoryID": 210, "SubCount": 0 }, "L.2.132": { "img": "", "CategoryID": 277, "SubCount": 6, "L.3.127": { "img": "1173128.Chat Icon.png", "CategoryID": 1211, "SubCount": 0 }, "L.3.128": { "img": "", "CategoryID": 1159, "SubCount": 0 }, "L.3.129": { "img": "", "CategoryID": 1084, "SubCount": 0 }, "L.3.130": { "img": "", "CategoryID": 1150, "SubCount": 0 }, "L.3.131": { "img": "", "CategoryID": 1138, "SubCount": 0 }, "L.3.132": { "img": "", "CategoryID": 1119, "SubCount": 0 } }, "L.2.145": { "img": "", "CategoryID": 639, "SubCount": 12, "L.3.134": { "img": "", "CategoryID": 122, "SubCount": 0 }, "L.3.135": { "img": "", "CategoryID": 121, "SubCount": 0 }, "L.3.136": { "img": "", "CategoryID": 512, "SubCount": 0 }, "L.3.137": { "img": "", "CategoryID": 124, "SubCount": 0 }, "L.3.138": { "img": "", "CategoryID": 125, "SubCount": 0 }, "L.3.139": { "img": "", "CategoryID": 127, "SubCount": 0 }, "L.3.140": { "img": "", "CategoryID": 878, "SubCount": 0 }, "L.3.141": { "img": "", "CategoryID": 877, "SubCount": 0 }, "L.3.142": { "img": "", "CategoryID": 880, "SubCount": 0 }, "L.3.143": { "img": "", "CategoryID": 879, "SubCount": 0 }, "L.3.144": { "img": "", "CategoryID": 874, "SubCount": 0 }, "L.3.145": { "img": "", "CategoryID": 282, "SubCount": 0 } }, "L.2.152": { "img": "", "CategoryID": 870, "SubCount": 6, "L.3.147": { "img": "", "CategoryID": 871, "SubCount": 0 }, "L.3.148": { "img": "", "CategoryID": 886, "SubCount": 0 }, "L.3.149": { "img": "", "CategoryID": 872, "SubCount": 0 }, "L.3.150": { "img": "", "CategoryID": 884, "SubCount": 0 }, "L.3.151": { "img": "", "CategoryID": 876, "SubCount": 0 }, "L.3.152": { "img": "", "CategoryID": 672, "SubCount": 0 } }, "L.2.158": { "img": "", "CategoryID": 282, "SubCount": 5, "L.3.154": { "img": "", "CategoryID": 122, "SubCount": 0 }, "L.3.155": { "img": "", "CategoryID": 512, "SubCount": 0 }, "L.3.156": { "img": "", "CategoryID": 121, "SubCount": 0 }, "L.3.157": { "img": "", "CategoryID": 124, "SubCount": 0 }, "L.3.158": { "img": "", "CategoryID": 127, "SubCount": 0 } }, "L.2.165": { "img": "", "CategoryID": 1191, "SubCount": 6, "L.3.160": { "img": "", "CategoryID": 1184, "SubCount": 0 }, "L.3.161": { "img": "", "CategoryID": 1186, "SubCount": 0 }, "L.3.162": { "img": "", "CategoryID": 1185, "SubCount": 0 }, "L.3.163": { "img": "", "CategoryID": 1187, "SubCount": 0 }, "L.3.164": { "img": "", "CategoryID": 1189, "SubCount": 0 }, "L.3.165": { "img": "", "CategoryID": 1190, "SubCount": 0 } }, "L.2.170": { "img": "", "CategoryID": 932, "SubCount": 4, "L.3.167": { "img": "", "CategoryID": 936, "SubCount": 0 }, "L.3.168": { "img": "", "CategoryID": 1181, "SubCount": 0 }, "L.3.169": { "img": "", "CategoryID": 331, "SubCount": 0 }, "L.3.170": { "img": "", "CategoryID": 1182, "SubCount": 0 } }, "L.2.171": { "img": "", "CategoryID": 332, "SubCount": 0 } } }}

let key_string = 'L.1.171~L.2.170'
let keys = key_string.split('~')

let found = keys.reduce((a, c) => a[c], OBJ.root)
console.log(found)




在给定密钥的情况下,可能有很多方法可以找到特定对象。一种方法是使用单个级别的键将您的结构展平为一个对象。然后你可以通过键得到一个特定的对象,例如:



var OBJ = { "root": { "SubCount": 4, "L.1.22": { "img": "", "CategoryID": 635, "SubCount": 4, "L.2.4": { "img": "", "CategoryID": 692, "SubCount": 1, "L.3.4": { "img": "", "CategoryID": 229, "SubCount": 0 } }, "L.2.10": { "img": "", "CategoryID": 213, "SubCount": 5, "L.3.6": { "img": "", "CategoryID": 46, "SubCount": 0 }, "L.3.7": { "img": "", "CategoryID": 48, "SubCount": 0 }, "L.3.8": { "img": "", "CategoryID": 49, "SubCount": 0 }, "L.3.9": { "img": "", "CategoryID": 50, "SubCount": 0 }, "L.3.10": { "img": "", "CategoryID": 95, "SubCount": 0 } }, "L.2.14": { "img": "", "CategoryID": 212, "SubCount": 3, "L.3.12": { "img": "", "CategoryID": 53, "SubCount": 0 }, "L.3.13": { "img": "", "CategoryID": 55, "SubCount": 0 }, "L.3.14": { "img": "", "CategoryID": 98, "SubCount": 0 } }, "L.2.22": { "img": "", "CategoryID": 211, "SubCount": 7, "L.3.16": { "img": "", "CategoryID": 46, "SubCount": 0 }, "L.3.17": { "img": "", "CategoryID": 49, "SubCount": 0 }, "L.3.18": { "img": "", "CategoryID": 50, "SubCount": 0 }, "L.3.19": { "img": "", "CategoryID": 52, "SubCount": 0 }, "L.3.20": { "img": "", "CategoryID": 54, "SubCount": 0 }, "L.3.21": { "img": "", "CategoryID": 95, "SubCount": 0 }, "L.3.22": { "img": "", "CategoryID": 98, "SubCount": 0 } } }, "L.1.100": { "img": "", "CategoryID": 689, "SubCount": 6, "L.2.38": { "img": "", "CategoryID": 225, "SubCount": 14, "L.3.25": { "img": "", "CategoryID": 612, "SubCount": 0 }, "L.3.26": { "img": "", "CategoryID": 773, "SubCount": 0 }, "L.3.27": { "img": "", "CategoryID": 1174, "SubCount": 0 }, "L.3.28": { "img": "", "CategoryID": 135, "SubCount": 0 }, "L.3.29": { "img": "", "CategoryID": 451, "SubCount": 0 }, "L.3.30": { "img": "", "CategoryID": 1169, "SubCount": 0 }, "L.3.31": { "img": "", "CategoryID": 403, "SubCount": 0 }, "L.3.32": { "img": "", "CategoryID": 136, "SubCount": 0 }, "L.3.33": { "img": "", "CategoryID": 133, "SubCount": 0 }, "L.3.34": { "img": "", "CategoryID": 134, "SubCount": 0 }, "L.3.35": { "img": "", "CategoryID": 138, "SubCount": 0 }, "L.3.36": { "img": "", "CategoryID": 137, "SubCount": 0 }, "L.3.37": { "img": "", "CategoryID": 132, "SubCount": 0 }, "L.3.38": { "img": "", "CategoryID": 130, "SubCount": 0 } }, "L.2.53": { "img": "", "CategoryID": 217, "SubCount": 14, "L.3.40": { "img": "", "CategoryID": 108, "SubCount": 0 }, "L.3.41": { "img": "", "CategoryID": 611, "SubCount": 0 }, "L.3.42": { "img": "", "CategoryID": 772, "SubCount": 0 }, "L.3.43": { "img": "", "CategoryID": 448, "SubCount": 0 }, "L.3.44": { "img": "", "CategoryID": 103, "SubCount": 0 }, "L.3.45": { "img": "", "CategoryID": 404, "SubCount": 0 }, "L.3.46": { "img": "", "CategoryID": 106, "SubCount": 0 }, "L.3.47": { "img": "", "CategoryID": 105, "SubCount": 0 }, "L.3.48": { "img": "", "CategoryID": 107, "SubCount": 0 }, "L.3.49": { "img": "", "CategoryID": 104, "SubCount": 0 }, "L.3.50": { "img": "", "CategoryID": 266, "SubCount": 0 }, "L.3.51": { "img": "", "CategoryID": 1168, "SubCount": 0 }, "L.3.52": { "img": "", "CategoryID": 1173, "SubCount": 0 }, "L.3.53": { "img": "", "CategoryID": 112, "SubCount": 0 } }, "L.2.68": { "img": "", "CategoryID": 219, "SubCount": 14, "L.3.55": { "img": "", "CategoryID": 613, "SubCount": 0 }, "L.3.56": { "img": "", "CategoryID": 775, "SubCount": 0 }, "L.3.57": { "img": "", "CategoryID": 450, "SubCount": 0 }, "L.3.58": { "img": "", "CategoryID": 144, "SubCount": 0 }, "L.3.59": { "img": "", "CategoryID": 146, "SubCount": 0 }, "L.3.60": { "img": "", "CategoryID": 400, "SubCount": 0 }, "L.3.61": { "img": "", "CategoryID": 145, "SubCount": 0 }, "L.3.62": { "img": "", "CategoryID": 151, "SubCount": 0 }, "L.3.63": { "img": "", "CategoryID": 150, "SubCount": 0 }, "L.3.64": { "img": "", "CategoryID": 147, "SubCount": 0 }, "L.3.65": { "img": "", "CategoryID": 1170, "SubCount": 0 }, "L.3.66": { "img": "", "CategoryID": 1176, "SubCount": 0 }, "L.3.67": { "img": "", "CategoryID": 143, "SubCount": 0 }, "L.3.68": { "img": "", "CategoryID": 141, "SubCount": 0 } }, "L.2.83": { "img": "", "CategoryID": 220, "SubCount": 14, "L.3.70": { "img": "", "CategoryID": 614, "SubCount": 0 }, "L.3.71": { "img": "", "CategoryID": 774, "SubCount": 0 }, "L.3.72": { "img": "", "CategoryID": 1171, "SubCount": 0 }, "L.3.73": { "img": "", "CategoryID": 1175, "SubCount": 0 }, "L.3.74": { "img": "", "CategoryID": 453, "SubCount": 0 }, "L.3.75": { "img": "", "CategoryID": 153, "SubCount": 0 }, "L.3.76": { "img": "", "CategoryID": 399, "SubCount": 0 }, "L.3.77": { "img": "", "CategoryID": 154, "SubCount": 0 }, "L.3.78": { "img": "", "CategoryID": 155, "SubCount": 0 }, "L.3.79": { "img": "", "CategoryID": 161, "SubCount": 0 }, "L.3.80": { "img": "", "CategoryID": 160, "SubCount": 0 }, "L.3.81": { "img": "", "CategoryID": 156, "SubCount": 0 }, "L.3.82": { "img": "", "CategoryID": 159, "SubCount": 0 }, "L.3.83": { "img": "", "CategoryID": 158, "SubCount": 0 } }, "L.2.98": { "img": "", "CategoryID": 698, "SubCount": 14, "L.3.85": { "img": "", "CategoryID": 776, "SubCount": 0 }, "L.3.86": { "img": "", "CategoryID": 1167, "SubCount": 0 }, "L.3.87": { "img": "", "CategoryID": 253, "SubCount": 0 }, "L.3.88": { "img": "", "CategoryID": 608, "SubCount": 0 }, "L.3.89": { "img": "", "CategoryID": 473, "SubCount": 0 }, "L.3.90": { "img": "", "CategoryID": 256, "SubCount": 0 }, "L.3.91": { "img": "", "CategoryID": 258, "SubCount": 0 }, "L.3.92": { "img": "", "CategoryID": 259, "SubCount": 0 }, "L.3.93": { "img": "", "CategoryID": 260, "SubCount": 0 }, "L.3.94": { "img": "", "CategoryID": 254, "SubCount": 0 }, "L.3.95": { "img": "", "CategoryID": 255, "SubCount": 0 }, "L.3.96": { "img": "", "CategoryID": 262, "SubCount": 0 }, "L.3.97": { "img": "", "CategoryID": 1172, "SubCount": 0 }, "L.3.98": { "img": "", "CategoryID": 397, "SubCount": 0 } }, "L.2.100": { "img": "", "CategoryID": 218, "SubCount": 1, "L.3.100": { "img": "", "CategoryID": 208, "SubCount": 0 } } }, "L.1.122": { "img": "", "CategoryID": 870, "SubCount": 6, "L.2.108": { "img": "", "CategoryID": 871, "SubCount": 6, "L.3.103": { "img": "", "CategoryID": 883, "SubCount": 0 }, "L.3.104": { "img": "", "CategoryID": 885, "SubCount": 0 }, "L.3.105": { "img": "", "CategoryID": 873, "SubCount": 0 }, "L.3.106": { "img": "", "CategoryID": 886, "SubCount": 0 }, "L.3.107": { "img": "", "CategoryID": 872, "SubCount": 0 }, "L.3.108": { "img": "", "CategoryID": 884, "SubCount": 0 } }, "L.2.109": { "img": "", "CategoryID": 886, "SubCount": 0 }, "L.2.110": { "img": "", "CategoryID": 872, "SubCount": 0 }, "L.2.111": { "img": "", "CategoryID": 884, "SubCount": 0 }, "L.2.112": { "img": "", "CategoryID": 876, "SubCount": 0 }, "L.2.122": { "img": "", "CategoryID": 672, "SubCount": 9, "L.3.114": { "img": "", "CategoryID": 839, "SubCount": 0 }, "L.3.115": { "img": "", "CategoryID": 210, "SubCount": 0 }, "L.3.116": { "img": "", "CategoryID": 277, "SubCount": 0 }, "L.3.117": { "img": "", "CategoryID": 639, "SubCount": 0 }, "L.3.118": { "img": "", "CategoryID": 870, "SubCount": 0 }, "L.3.119": { "img": "", "CategoryID": 282, "SubCount": 0 }, "L.3.120": { "img": "", "CategoryID": 1191, "SubCount": 0 }, "L.3.121": { "img": "", "CategoryID": 932, "SubCount": 0 }, "L.3.122": { "img": "", "CategoryID": 332, "SubCount": 0 } } }, "L.1.171": { "img": "", "CategoryID": 672, "SubCount": 9, "L.2.124": { "img": "", "CategoryID": 839, "SubCount": 0 }, "L.2.125": { "img": "", "CategoryID": 210, "SubCount": 0 }, "L.2.132": { "img": "", "CategoryID": 277, "SubCount": 6, "L.3.127": { "img": "1173128.Chat Icon.png", "CategoryID": 1211, "SubCount": 0 }, "L.3.128": { "img": "", "CategoryID": 1159, "SubCount": 0 }, "L.3.129": { "img": "", "CategoryID": 1084, "SubCount": 0 }, "L.3.130": { "img": "", "CategoryID": 1150, "SubCount": 0 }, "L.3.131": { "img": "", "CategoryID": 1138, "SubCount": 0 }, "L.3.132": { "img": "", "CategoryID": 1119, "SubCount": 0 } }, "L.2.145": { "img": "", "CategoryID": 639, "SubCount": 12, "L.3.134": { "img": "", "CategoryID": 122, "SubCount": 0 }, "L.3.135": { "img": "", "CategoryID": 121, "SubCount": 0 }, "L.3.136": { "img": "", "CategoryID": 512, "SubCount": 0 }, "L.3.137": { "img": "", "CategoryID": 124, "SubCount": 0 }, "L.3.138": { "img": "", "CategoryID": 125, "SubCount": 0 }, "L.3.139": { "img": "", "CategoryID": 127, "SubCount": 0 }, "L.3.140": { "img": "", "CategoryID": 878, "SubCount": 0 }, "L.3.141": { "img": "", "CategoryID": 877, "SubCount": 0 }, "L.3.142": { "img": "", "CategoryID": 880, "SubCount": 0 }, "L.3.143": { "img": "", "CategoryID": 879, "SubCount": 0 }, "L.3.144": { "img": "", "CategoryID": 874, "SubCount": 0 }, "L.3.145": { "img": "", "CategoryID": 282, "SubCount": 0 } }, "L.2.152": { "img": "", "CategoryID": 870, "SubCount": 6, "L.3.147": { "img": "", "CategoryID": 871, "SubCount": 0 }, "L.3.148": { "img": "", "CategoryID": 886, "SubCount": 0 }, "L.3.149": { "img": "", "CategoryID": 872, "SubCount": 0 }, "L.3.150": { "img": "", "CategoryID": 884, "SubCount": 0 }, "L.3.151": { "img": "", "CategoryID": 876, "SubCount": 0 }, "L.3.152": { "img": "", "CategoryID": 672, "SubCount": 0 } }, "L.2.158": { "img": "", "CategoryID": 282, "SubCount": 5, "L.3.154": { "img": "", "CategoryID": 122, "SubCount": 0 }, "L.3.155": { "img": "", "CategoryID": 512, "SubCount": 0 }, "L.3.156": { "img": "", "CategoryID": 121, "SubCount": 0 }, "L.3.157": { "img": "", "CategoryID": 124, "SubCount": 0 }, "L.3.158": { "img": "", "CategoryID": 127, "SubCount": 0 } }, "L.2.165": { "img": "", "CategoryID": 1191, "SubCount": 6, "L.3.160": { "img": "", "CategoryID": 1184, "SubCount": 0 }, "L.3.161": { "img": "", "CategoryID": 1186, "SubCount": 0 }, "L.3.162": { "img": "", "CategoryID": 1185, "SubCount": 0 }, "L.3.163": { "img": "", "CategoryID": 1187, "SubCount": 0 }, "L.3.164": { "img": "", "CategoryID": 1189, "SubCount": 0 }, "L.3.165": { "img": "", "CategoryID": 1190, "SubCount": 0 } }, "L.2.170": { "img": "", "CategoryID": 932, "SubCount": 4, "L.3.167": { "img": "", "CategoryID": 936, "SubCount": 0 }, "L.3.168": { "img": "", "CategoryID": 1181, "SubCount": 0 }, "L.3.169": { "img": "", "CategoryID": 331, "SubCount": 0 }, "L.3.170": { "img": "", "CategoryID": 1182, "SubCount": 0 } }, "L.2.171": { "img": "", "CategoryID": 332, "SubCount": 0 } } }}


function make_lookup(obj, map_obj = {}) {
  let children = Object.keys(obj).filter(k => k.startsWith('L.'))
  if (!children) return map_obj
  children.forEach(c => {
    map_obj[c] = obj[c]
    make_lookup(obj[c], map_obj)
  })
  return map_obj
}

let myMap = make_lookup(OBJ['root'])

// lookup L.2.170
console.log(myMap['L.2.170'])

// lookup L.3.169
console.log(myMap['L.3.169'])




将上述内容转换为返回键数组而不是对象本身的内容并不困难,但它并不清楚你想要的是什么。

答案 1 :(得分:0)

我建议首先将要检索的数据结构映射到可以在为菜单构建DOM时更容易使用的内容。

在下面的代码段中,以L.开头的密钥将变为一个菜单项数组,其中密钥在菜单项上显示为id。然后,菜单项内的所有后续键都映射到children数组,该数组也包含菜单项。此数据结构允许您更轻松地遍历菜单项列表及其各自的子菜单。

let responseData = getData()
let menuItems = parseMenuItems(responseData.root)

document.body.appendChild(renderMenuItems(menuItems))

function parseMenuItems (input) {
  return Object.keys(input)
    .filter(key => key.startsWith('L.'))
    .map(menuId => {
      let menuItem = Object.assign({
        id: menuId,
        children: parseMenuItems(input[menuId])
      }, input[menuId])
      
      menuItem.children.forEach(childItem => {
        delete menuItem[childItem.id]
      })
      
      return menuItem
    })
}

function renderMenuItems (menuItems) {
  let ul = document.createElement('ul')
  
  menuItems.forEach(menuItem => {
    let li = document.createElement('li')
    li.textContent = menuItem.id
    
    if (menuItem.children.length > 0) {
      li.appendChild(renderMenuItems(menuItem.children))
    }
    
    ul.appendChild(li)
  })
  
  return ul
}

function getData () {
  return {
    "root": {
      "SubCount": 4,
      "L.1.22": {
        "img": "",
        "CategoryID": 635,
        "SubCount": 4,
        "L.2.4": {
          "img": "",
          "CategoryID": 692,
          "SubCount": 1,
          "L.3.4": { "img": "", "CategoryID": 229, "SubCount": 0 }
        },
        "L.2.10": {
          "img": "",
          "CategoryID": 213,
          "SubCount": 5,
          "L.3.6": { "img": "", "CategoryID": 46, "SubCount": 0 },
          "L.3.7": { "img": "", "CategoryID": 48, "SubCount": 0 },
          "L.3.8": { "img": "", "CategoryID": 49, "SubCount": 0 },
          "L.3.9": { "img": "", "CategoryID": 50, "SubCount": 0 },
          "L.3.10": { "img": "", "CategoryID": 95, "SubCount": 0 }
        },
        "L.2.14": {
          "img": "",
          "CategoryID": 212,
          "SubCount": 3,
          "L.3.12": { "img": "", "CategoryID": 53, "SubCount": 0 },
          "L.3.13": { "img": "", "CategoryID": 55, "SubCount": 0 },
          "L.3.14": { "img": "", "CategoryID": 98, "SubCount": 0 }
        },
        "L.2.22": {
          "img": "",
          "CategoryID": 211,
          "SubCount": 7,
          "L.3.16": { "img": "", "CategoryID": 46, "SubCount": 0 },
          "L.3.17": { "img": "", "CategoryID": 49, "SubCount": 0 },
          "L.3.18": { "img": "", "CategoryID": 50, "SubCount": 0 },
          "L.3.19": { "img": "", "CategoryID": 52, "SubCount": 0 },
          "L.3.20": { "img": "", "CategoryID": 54, "SubCount": 0 },
          "L.3.21": { "img": "", "CategoryID": 95, "SubCount": 0 },
          "L.3.22": { "img": "", "CategoryID": 98, "SubCount": 0 }
        }
      },
      "L.1.100": {
        "img": "",
        "CategoryID": 689,
        "SubCount": 6,
        "L.2.38": {
          "img": "",
          "CategoryID": 225,
          "SubCount": 14,
          "L.3.25": { "img": "", "CategoryID": 612, "SubCount": 0 },
          "L.3.26": { "img": "", "CategoryID": 773, "SubCount": 0 },
          "L.3.27": { "img": "", "CategoryID": 1174, "SubCount": 0 },
          "L.3.28": { "img": "", "CategoryID": 135, "SubCount": 0 },
          "L.3.29": { "img": "", "CategoryID": 451, "SubCount": 0 },
          "L.3.30": { "img": "", "CategoryID": 1169, "SubCount": 0 },
          "L.3.31": { "img": "", "CategoryID": 403, "SubCount": 0 },
          "L.3.32": { "img": "", "CategoryID": 136, "SubCount": 0 },
          "L.3.33": { "img": "", "CategoryID": 133, "SubCount": 0 },
          "L.3.34": { "img": "", "CategoryID": 134, "SubCount": 0 },
          "L.3.35": { "img": "", "CategoryID": 138, "SubCount": 0 },
          "L.3.36": { "img": "", "CategoryID": 137, "SubCount": 0 },
          "L.3.37": { "img": "", "CategoryID": 132, "SubCount": 0 },
          "L.3.38": { "img": "", "CategoryID": 130, "SubCount": 0 }
        },
        "L.2.53": {
          "img": "",
          "CategoryID": 217,
          "SubCount": 14,
          "L.3.40": { "img": "", "CategoryID": 108, "SubCount": 0 },
          "L.3.41": { "img": "", "CategoryID": 611, "SubCount": 0 },
          "L.3.42": { "img": "", "CategoryID": 772, "SubCount": 0 },
          "L.3.43": { "img": "", "CategoryID": 448, "SubCount": 0 },
          "L.3.44": { "img": "", "CategoryID": 103, "SubCount": 0 },
          "L.3.45": { "img": "", "CategoryID": 404, "SubCount": 0 },
          "L.3.46": { "img": "", "CategoryID": 106, "SubCount": 0 },
          "L.3.47": { "img": "", "CategoryID": 105, "SubCount": 0 },
          "L.3.48": { "img": "", "CategoryID": 107, "SubCount": 0 },
          "L.3.49": { "img": "", "CategoryID": 104, "SubCount": 0 },
          "L.3.50": { "img": "", "CategoryID": 266, "SubCount": 0 },
          "L.3.51": { "img": "", "CategoryID": 1168, "SubCount": 0 },
          "L.3.52": { "img": "", "CategoryID": 1173, "SubCount": 0 },
          "L.3.53": { "img": "", "CategoryID": 112, "SubCount": 0 }
        },
        "L.2.68": {
          "img": "",
          "CategoryID": 219,
          "SubCount": 14,
          "L.3.55": { "img": "", "CategoryID": 613, "SubCount": 0 },
          "L.3.56": { "img": "", "CategoryID": 775, "SubCount": 0 },
          "L.3.57": { "img": "", "CategoryID": 450, "SubCount": 0 },
          "L.3.58": { "img": "", "CategoryID": 144, "SubCount": 0 },
          "L.3.59": { "img": "", "CategoryID": 146, "SubCount": 0 },
          "L.3.60": { "img": "", "CategoryID": 400, "SubCount": 0 },
          "L.3.61": { "img": "", "CategoryID": 145, "SubCount": 0 },
          "L.3.62": { "img": "", "CategoryID": 151, "SubCount": 0 },
          "L.3.63": { "img": "", "CategoryID": 150, "SubCount": 0 },
          "L.3.64": { "img": "", "CategoryID": 147, "SubCount": 0 },
          "L.3.65": { "img": "", "CategoryID": 1170, "SubCount": 0 },
          "L.3.66": { "img": "", "CategoryID": 1176, "SubCount": 0 },
          "L.3.67": { "img": "", "CategoryID": 143, "SubCount": 0 },
          "L.3.68": { "img": "", "CategoryID": 141, "SubCount": 0 }
        },
        "L.2.83": {
          "img": "",
          "CategoryID": 220,
          "SubCount": 14,
          "L.3.70": { "img": "", "CategoryID": 614, "SubCount": 0 },
          "L.3.71": { "img": "", "CategoryID": 774, "SubCount": 0 },
          "L.3.72": { "img": "", "CategoryID": 1171, "SubCount": 0 },
          "L.3.73": { "img": "", "CategoryID": 1175, "SubCount": 0 },
          "L.3.74": { "img": "", "CategoryID": 453, "SubCount": 0 },
          "L.3.75": { "img": "", "CategoryID": 153, "SubCount": 0 },
          "L.3.76": { "img": "", "CategoryID": 399, "SubCount": 0 },
          "L.3.77": { "img": "", "CategoryID": 154, "SubCount": 0 },
          "L.3.78": { "img": "", "CategoryID": 155, "SubCount": 0 },
          "L.3.79": { "img": "", "CategoryID": 161, "SubCount": 0 },
          "L.3.80": { "img": "", "CategoryID": 160, "SubCount": 0 },
          "L.3.81": { "img": "", "CategoryID": 156, "SubCount": 0 },
          "L.3.82": { "img": "", "CategoryID": 159, "SubCount": 0 },
          "L.3.83": { "img": "", "CategoryID": 158, "SubCount": 0 }
        },
        "L.2.98": {
          "img": "",
          "CategoryID": 698,
          "SubCount": 14,
          "L.3.85": { "img": "", "CategoryID": 776, "SubCount": 0 },
          "L.3.86": { "img": "", "CategoryID": 1167, "SubCount": 0 },
          "L.3.87": { "img": "", "CategoryID": 253, "SubCount": 0 },
          "L.3.88": { "img": "", "CategoryID": 608, "SubCount": 0 },
          "L.3.89": { "img": "", "CategoryID": 473, "SubCount": 0 },
          "L.3.90": { "img": "", "CategoryID": 256, "SubCount": 0 },
          "L.3.91": { "img": "", "CategoryID": 258, "SubCount": 0 },
          "L.3.92": { "img": "", "CategoryID": 259, "SubCount": 0 },
          "L.3.93": { "img": "", "CategoryID": 260, "SubCount": 0 },
          "L.3.94": { "img": "", "CategoryID": 254, "SubCount": 0 },
          "L.3.95": { "img": "", "CategoryID": 255, "SubCount": 0 },
          "L.3.96": { "img": "", "CategoryID": 262, "SubCount": 0 },
          "L.3.97": { "img": "", "CategoryID": 1172, "SubCount": 0 },
          "L.3.98": { "img": "", "CategoryID": 397, "SubCount": 0 }
        },
        "L.2.100": {
          "img": "",
          "CategoryID": 218,
          "SubCount": 1,
          "L.3.100": { "img": "", "CategoryID": 208, "SubCount": 0 }
        }
      },
      "L.1.122": {
        "img": "",
        "CategoryID": 870,
        "SubCount": 6,
        "L.2.108": {
          "img": "", "CategoryID": 871, "SubCount": 6,
          "L.3.103": { "img": "", "CategoryID": 883, "SubCount": 0 },
          "L.3.104": { "img": "", "CategoryID": 885, "SubCount": 0 },
          "L.3.105": { "img": "", "CategoryID": 873, "SubCount": 0 },
          "L.3.106": { "img": "", "CategoryID": 886, "SubCount": 0 },
          "L.3.107": { "img": "", "CategoryID": 872, "SubCount": 0 },
          "L.3.108": { "img": "", "CategoryID": 884, "SubCount": 0 }
        },
        "L.2.109": { "img": "", "CategoryID": 886, "SubCount": 0 },
        "L.2.110": { "img": "", "CategoryID": 872, "SubCount": 0 },
        "L.2.111": { "img": "", "CategoryID": 884, "SubCount": 0 },
        "L.2.112": { "img": "", "CategoryID": 876, "SubCount": 0 },
        "L.2.122": {
          "img": "",
          "CategoryID": 672,
          "SubCount": 9,
          "L.3.114": { "img": "", "CategoryID": 839, "SubCount": 0 },
          "L.3.115": { "img": "", "CategoryID": 210, "SubCount": 0 },
          "L.3.116": { "img": "", "CategoryID": 277, "SubCount": 0 },
          "L.3.117": { "img": "", "CategoryID": 639, "SubCount": 0 },
          "L.3.118": { "img": "", "CategoryID": 870, "SubCount": 0 },
          "L.3.119": { "img": "", "CategoryID": 282, "SubCount": 0 },
          "L.3.120": { "img": "", "CategoryID": 1191, "SubCount": 0 },
          "L.3.121": { "img": "", "CategoryID": 932, "SubCount": 0 },
          "L.3.122": { "img": "", "CategoryID": 332, "SubCount": 0 }
        }
      },
      "L.1.171": {
        "img": "",
        "CategoryID": 672,
        "SubCount": 9,
        "L.2.124": { "img": "", "CategoryID": 839, "SubCount": 0 },
        "L.2.125": { "img": "", "CategoryID": 210, "SubCount": 0 },
        "L.2.132": {
          "img": "",
          "CategoryID": 277,
          "SubCount": 6,
          "L.3.127": { "img": "1173128.Chat Icon.png", "CategoryID": 1211, "SubCount": 0 },
          "L.3.128": { "img": "", "CategoryID": 1159, "SubCount": 0 },
          "L.3.129": { "img": "", "CategoryID": 1084, "SubCount": 0 },
          "L.3.130": { "img": "", "CategoryID": 1150, "SubCount": 0 },
          "L.3.131": { "img": "", "CategoryID": 1138, "SubCount": 0 },
          "L.3.132": { "img": "", "CategoryID": 1119, "SubCount": 0 }
        },
        "L.2.145": {
          "img": "",
          "CategoryID": 639,
          "SubCount": 12,
          "L.3.134": { "img": "", "CategoryID": 122, "SubCount": 0 },
          "L.3.135": { "img": "", "CategoryID": 121, "SubCount": 0 },
          "L.3.136": { "img": "", "CategoryID": 512, "SubCount": 0 },
          "L.3.137": { "img": "", "CategoryID": 124, "SubCount": 0 },
          "L.3.138": { "img": "", "CategoryID": 125, "SubCount": 0 },
          "L.3.139": { "img": "", "CategoryID": 127, "SubCount": 0 },
          "L.3.140": { "img": "", "CategoryID": 878, "SubCount": 0 },
          "L.3.141": { "img": "", "CategoryID": 877, "SubCount": 0 },
          "L.3.142": { "img": "", "CategoryID": 880, "SubCount": 0 },
          "L.3.143": { "img": "", "CategoryID": 879, "SubCount": 0 },
          "L.3.144": { "img": "", "CategoryID": 874, "SubCount": 0 },
          "L.3.145": { "img": "", "CategoryID": 282, "SubCount": 0 }
        },
        "L.2.152": {
          "img": "",
          "CategoryID": 870,
          "SubCount": 6,
          "L.3.147": { "img": "", "CategoryID": 871, "SubCount": 0 },
          "L.3.148": { "img": "", "CategoryID": 886, "SubCount": 0 },
          "L.3.149": { "img": "", "CategoryID": 872, "SubCount": 0 },
          "L.3.150": { "img": "", "CategoryID": 884, "SubCount": 0 },
          "L.3.151": { "img": "", "CategoryID": 876, "SubCount": 0 },
          "L.3.152": { "img": "", "CategoryID": 672, "SubCount": 0 }
        },
        "L.2.158": {
          "img": "",
          "CategoryID": 282,
          "SubCount": 5,
          "L.3.154": { "img": "", "CategoryID": 122, "SubCount": 0 },
          "L.3.155": { "img": "", "CategoryID": 512, "SubCount": 0 },
          "L.3.156": { "img": "", "CategoryID": 121, "SubCount": 0 },
          "L.3.157": { "img": "", "CategoryID": 124, "SubCount": 0 },
          "L.3.158": { "img": "", "CategoryID": 127, "SubCount": 0 }
        },
        "L.2.165": {
          "img": "",
          "CategoryID": 1191,
          "SubCount": 6,
          "L.3.160": { "img": "", "CategoryID": 1184, "SubCount": 0 },
          "L.3.161": { "img": "", "CategoryID": 1186, "SubCount": 0 },
          "L.3.162": { "img": "", "CategoryID": 1185, "SubCount": 0 },
          "L.3.163": { "img": "", "CategoryID": 1187, "SubCount": 0 },
          "L.3.164": { "img": "", "CategoryID": 1189, "SubCount": 0 },
          "L.3.165": { "img": "", "CategoryID": 1190, "SubCount": 0 }
        },
        "L.2.170": {
          "img": "",
          "CategoryID": 932,
          "SubCount": 4,
          "L.3.167": { "img": "", "CategoryID": 936, "SubCount": 0 },
          "L.3.168": { "img": "", "CategoryID": 1181, "SubCount": 0 },
          "L.3.169": { "img": "", "CategoryID": 331, "SubCount": 0 },
          "L.3.170": { "img": "", "CategoryID": 1182, "SubCount": 0 }
        },
        "L.2.171": { "img": "", "CategoryID": 332, "SubCount": 0 }
      }
    }
  }
}