我为运动创建了 JSON,看起来像
[
{
"sportName": "Men's Basketball",
"path": "mbasket",
"sportID": 7,
"parentSportName": "Basketball"
},
{
"sportName": "Women's BasketBall",
"path": "wcc",
"sportID": 8,
"parentSportName": "Basketball"
},
{
"sportName": "Women's Cross Country",
"path": "wbasket",
"sportID": 9,
"parentSportName": "Cross Country"
},
{
"sportName": "Men's Cross Country",
"path": "mcc",
"sportID": 10,
"parentSportName": "Cross Country"
}
]
我想使用 jQuery 获取唯一的 parentSportName,但我想知道我的 JSON 结构是否正确或者我需要做一些修改。我需要在创建嵌套列表时重新获取值,并且我的 SLOC 正在增加。