hihi我正在做一個關於ajax(xmlHttRequest)的項目, 我如何打電話給筆記會話中的標題,因爲通常如果你打電話給開始年就像detail = eval.... then for loop it inside should be var start year="" startyear += ...[i].startyear
這樣的事情,但我怎麼樣打電話給筆記裏面的標題? 我嘗試調用detail.notes.note.title它說的是空或不是一個對象給定的錯誤在Ajax請求中發送json數組?使用javascript
這是JSON數據:
{
"infos": {
"info": [
{
"startYear": "1900",
"endYear": "1930",
"timeZoneDesc": "daweerrewereopreproewropewredfkfdufssfsfsfsfrerewrBlahhhhh..",
"timeZoneID": "1",
"note": {
"notes": [
{
"id": "1",
"title": "Mmm"
},
{
"id": "2",
"title": "Wmm"
},
{
"id": "3",
"title": "Smm"
}
]
},
"links": [
{
"id": "1",
"title": "Red House",
"url": "http://infopedia.nl.sg/articles/SIP_611_2004-12-24.html"
},
{
"id": "2",
"title": "Joo Chiat",
"url": "http://www.the-inncrowd.com/joochiat.htm"
},
{
"id": "3",
"title": "Bake",
"url": "https://thelongnwindingroad.wordpress.com/tag/red-house-bakery"
}
]
}
]
}
}
嗚。標點符號,語法和拼寫可能會使這個問題變得可以理解。 – Hyperboreus 2011-05-24 02:44:54
@Hyperboreus你知道嗎? – cutexxbaby 2011-05-24 02:51:28
您的解析器將無法讀取您的JSON,因爲它格式不正確。嘗試修復它,然後嘗試再次解析。 – Hyperboreus 2011-05-24 02:54:34