json 配列 "projectDetail" を解析する次の jquery 関数がありますが、未定義として表示されている配列から ApprovalDesc の値を出力しようとすると、正しい構文を教えてください。
function show(projectDetail) {
var project = projectDetail;
$.each(project, function (i, tweet) {
$.each(tweet.ProjectUpdates, function (i, tweet1) {
$.each(tweet1.ProjectApproval, function (i, tweet2) {
alert(i + ': ' + tweet2.ApprovalDesc);
var PStatus = tweet.ApprovalDesc;
});
});
});
}
json出力
{ "d" : {
"ProjectUpdates" : { "ExceptionId" : 0,
"ProjectApproval" : [ { "ApprovalDesc" : "ABCApproved",
"CreatedBy" : null,
"CreatedDate" : "/Date(-62135596800000)/",
"ModifiedDate" : "/Date(-62135596800000)/",
"ApprovalDesc" : "welcome",
"SortOrder" : 1
} ],
"ProjectStatusGallery" : [ { "CategoryId" : 0,
"CreatedBy" : null,
"CreatedDate" : "/Date(-62135596800000)/",
"ImageName" : "flower",
"ImageUrl" : "D://Images",
"ModifiedBy" : null,
"ModifiedDate" : "/Date(-62135596800000)/",
},
{ "CategoryId" : 0,
"CreatedBy" : null,
"CreatedDate" : "/Date(-62135596800000)/",
"ImageName" : "flower2",
"ImageUrl" : "D://Images",
"ModifiedBy" : null,
"ModifiedDate" : "/Date(-62135596800000)/"
}
]
},
"__type" : "sample"
} }