给出的错误在ajax请求中发送json数组?使用javascript

时间:2011-05-24 02:18:23

标签: ajax json

hihi我正在做一个关于ajax(xmlHttRequest)的项目, 我将如何在笔记会话中调用标题,因为通常如果你打电话给开始年份就像detail = eval.... then for loop it inside should be var start year="" startyear += ...[i].startyear 像这样的东西,但我怎么称呼音符里面的标题?  我试着调用detail.notes.note.title它说是null或不是对象

这是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"
                }
            ]
        }
    ]
}

}

1 个答案:

答案 0 :(得分:0)

使用http://jsonlint.com/来帮助您使用JSON。

我得到了这个......

Parse error on line 30:
...         ]        }
----------------------^
Expecting '}', ',', ']'