我得到一个如下的 JSON 字符串
[
{
"id": 20,
"title": "a",
"allDay": true,
"start": "2012-12-04 00:00",
"end": "2012-12-07 00:00",
"color": "#eb491d",
"startDate": "/Date(1354559400000)/",
"endDate": "/Date(1354818600000)/",
"Location": "a",
"StartDatestr": "2012-12-04",
"EndDatestr": "2012-12-04",
"StartTime": "00:00",
"EndTime": "00:00",
"Alert": false,
"Repeat": false,
"RepeatDays": 0,
"CalendarID": 13,
"CustomerNo": 593963,
"CustomerName": "test_apple",
"IsProspect": true,
"Description": ""
}
]
当我检查如下长度时,它返回“1”
console.log(myAppointment.length);
但是当我尝试如下访问时,它会给出未定义的错误。
var myAppointment = JSON.parse(data.d);
sessionStorage.CustomerID = data.CustomerNo;
console.log(sessionStorage.CustomerID);
我不知道。谁能告诉我我在这里缺少什么