DO NOT stringify. PARSE. Based on the object you returned....
$.ajax({
url: "viewDayDocuments",
type: 'post',
data: {currentDay: currentDay, currentMonth: currentMonth, currentYear: currentYear},
success: function(result){
$('.list').text('');
$('.list').remove();
incomingDoc = JSON.parse(result);
incomingDoc.details[/*indexhere*/].referenceNo; //gives you a reference number.
}
});
I'll leave it up to you to loop through the indeces of incomingDoc.details.