尝试解析从Web服务返回的以下有效json数据;
{"SwipeArray":[
{"UserID": "@xxxxxxxx",
"Date": "8/24/2011 10:41:38 AM",
"Lab": "5"
}
]}
使用此代码;
$.ajax({
type: "POST",
... etc
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (json1) {
var y = json1.SwipeArray[0].Lab;
在上面的第一行获取此错误;
Microsoft JScript runtime error: 'SwipeArray.0' is null or not an object