我有一份以色人种格式的运动员名单。 在使用假体时,我想 gr掉名册上的所有名字; at子和大体;名字,然后把它们插入倒塌的菜单。
但是,出于某种原因, lo不行。 如果我看一看一看一看一看一看一看一看一看一看一看一看一看一看一看一看一看一看一看一看一看一看一看一去。 难道我要混淆一下阵列和物体吗?
JSON代码
{
"team": {
"color": "000000",
"country": "USA",
"roster": [
{
"athlete": {
"name": "John Doe",
"age": 20
}
},
{
"athlete": {
"name": "Jane Doe",
"age": 21
}
},
{
"athlete": {
"name": "Jack Doe",
"age": 22
}
},
{
"athlete": {
"name": "Joe Doe",
"age": 23
}
}
]
}
}
我有一份以色人种格式的运动员名单。 在使用假体时,我想 gr掉名册上的所有名字; at子和大体;名字,然后把它们插入倒塌的菜单。
但是,出于某种原因, lo不行。 如果我看一看一看一看一看一看一看一看一看一看一看一看一看一看一看一看一看一看一看一看一看一看一看一去。 难道我要混淆一下阵列和物体吗?
JSON代码
{ "team": { "color": "000000", "country": "USA", "roster": [ { "athlete": { "name": "John Doe", "age": 20 } }, { "athlete": { "name": "Jane Doe", "age": 21 } }, { "athlete": { "name": "Jack Doe", "age": 22 } }, { "athlete": { "name": "Joe Doe", "age": 23 } } ] } } JS code
async function getAthletes() {
const getPlayers = document.getElementById( getPlayers )
await fetch( athlete.json , {
method: GET
})
.then((response) => response.json())
.then(data => {
const athletes = data.team.roster[0].athlete
for(let i = 0; i < athletes.length; i++) {
getPlayers.inner传真 += `<option value="${athletes[i].name}">${athletes[i].name}</option>`
}
})
}
传真
<select id="getPlayers" data-category="Vote" data-action="click" data-label="Select Player">
<option value="">Select player</option>
</select>
希望在会后再照此办理。
<select id="getPlayers" data-category="pick" data-action="click" data-label="Select Player">
<option value>Select player</option>
<option value="John Doe">John Doe</option>
<option value="Jane Doe">Jane Doe</option>
<option value="Jack Doe">Jack Doe</option>
<option value="Joe Doe">Joe Doe</option>
</select>