我从 $.getJSON 调用中得到了这个响应。现在我想用“selected”选择对象的名称属性:true,并将其打印到 id 为 charTitle 的 div。
"titles": [{
"id": 17,
"name": "Sergeant %s"
}, {
"id": 53,
"name": "%s, Champion of the Naaru"
}, {
"id": 64,
"name": "%s, Hand of A'dal",
"selected": true
}]