I have a 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 resultArr values.
for example, I want to print ID = 1 APPROVAL LEVEL = 1 .. like this
i can get the value of ID, APPROVAL LEVEL .. with 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 also want to print these names ...
which means i want to print the KEY and VALUE of the data.resultArr array
How can i do this?
source
share