I have submitted my form using following code
$(document).ready(function() {
$.ajax({
type: "POST",
url: "https://cors-anywhere.herokuapp.com/https://api.digitallocker.gov.in/public/oauth2/1/files/issued",
headers:{
'Authorization' : 'Bearer '+$('#access_token').val()
},
dataType: "json",
success: function (data) {
console.log(data);
},
error: function(xhr, status, error) {
alert(xhr.responseText);
}
});
});
and I received the following output in my console.
{items: Array(6), resource: "D"}
items: Array(6)
0:
date: "2x-x-xxx"
description: "Aadhaar Card"
doctype: "ADHAR"
issuer: "Aadhaar, Unique Identification Authority of India"
issuerid: "in.gov.uidai"
mime: "application/pdf"
name: "Aadhaar Card"
parent: ""
size: ""
type: "file"
uri: "in.gov.uidai-ADHAR-xxxxxxx"
__proto__: Object
I want to print the above output as Table in my HTML.
I have tried so far
jQuery(data).each(function(i, obj) {
jQuery('#doc_list').append("<tr><td>"+obj.items['date'] + ' </td><td>' + obj.description + "</td></tr>");
});