I have the following jquery function to parse the json array "projectDetail" , but when i try print the value of ApprovalDesc from the array its showing as undefined, please can i know what is the right syntax ?
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 output
{ "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"
} }