1 回答

TA貢獻1757條經(jīng)驗 獲得超8個贊
作為評論中的 json 代碼,您可以執(zhí)行以下操作:
var obj = JSON.parse('[{"first_name":"john","last_name":"doe"},{"first_name":"Jeen","last_name":"dra"},{"first_name":"Ad","last_name":"Does"},{"first_name":"Arin","last_name":"Gan"},{"first_name":"Jason","last_name":"Ford"},{"first_name":"Prince","last_name":"addar"},{"first_name":"Derek","last_name":"Frenzi"},{"first_name":"Jay","last_name":"dar"},{"first_name":"dam","last_name":"guly"},{"first_name":"nita","last_name":"Sa"}]');
for (i=0 ; i<obj.length ; i++){
document.getElementById("demo").innerHTML += obj[i].first_name + " " + obj[i].last_name + "<br>" ;
}
- 1 回答
- 0 關注
- 192 瀏覽
添加回答
舉報