I have Json object like this
{
" resultArr": [
{
"ID":"1",
"0":"1",
"APPROVAL LEVEL":"1",
"1":"1",
"WorkFlow Type Code":"1",
"2":"1",
"Employee Number":"825489602V",
"3":"825489602V",
"Employee Name":"Wajira Wanigasekara",
"4":"Wajira Wanigasekara"
}
]
}
i am trying to print the key and values of the resultArr.
for example, i want to print ID=1 APPROVAL LEVEL=1.. like that
i can get value of ID,APPROVAL LEVEL.. using this code
$.ajax({
type: "POST",
async:false,
url: "<?php echo url_for('workflow/getApprovalByModuleView') ?>",
data: { viewName: viewName },
dataType: "json",
success: function(data){
alert(data.resultArr[0][3]);
}
});
but i want print the those names also...
that mean i want the print the KEY and VALUE of the data.resultArr array
how can i do that?