我的JSON看起来像这样:
{
"title": "Star Chart",
"locations": [
{
"name": "Mercury",
"faction": "Grineer",
"enemyLvl": "6 - 11",
"missCount": "11 Missions",
"missions": [
{
"name": "Apollodorus",
"target": "Infestation",
"type": "Survival",
"planet": "Mercury"
},
{
"name": "Boethius",
"target": "Infestation",
"type": "Exterminate",
"planet": "Mercury"
}
]
},
{
"name": "Venus",
"faction": "Corpus",
"enemyLvl": "3 - 18",
"missCount": "14 Missions",
"missions": [
{
"name": "Aphrodite",
"target": "Corpus",
"type": "Mobile Defense",
"planet": "Venus"
},
{
"name": "Cytherean",
"target": "Corpus",
"type": "Interception",
"planet": "Venus"
}
]
}
]
}
我的问题是,在位置2,我从位置1获得相同的任务结果。
请参阅jsfiddle了解我的意思。 也许我会在正确设置任务计数方面得到一些帮助。
答案 0 :(得分:0)
你的问题在于:$(data.locations[0].missions).each...
0
已经很难了。请改用index
。