Here is a json encoded result:
{
"result":[
{
"CODE":"STC\/R\/935",
"WAY":"In",
"DATE":"2016-02-19",
"TYPE":"Re-Entry",
"TKTP":"NA",
"TIME":"2016-02-23 17:52:37"
},
{
"CODE":"5\/105",
"WAY":"In",
"DATE":"2016-01-30",
"TYPE":"Re-Entry",
"TKTP":"NA",
"TIME":"2016-02-23 17:52:37"
},
{
"CODE":"356",
"WAY":"In",
"DATE":"2016-02-06",
"TYPE":"Re-Entry",
"TKTP":"NA",
"TIME":"2016-02-23 17:52:37"
},
{
"CODE":"FCC\/ETC\/01",
"WAY":"In",
"DATE":"2016-02-10",
"TYPE":"Re-Entry",
"TKTP":"NA",
"TIME":"2016-02-23 17:52:37"
},
{
"CODE":"3\/739",
"WAY":"In",
"DATE":"2016-02-03",
"TYPE":"Re-Entry",
"TKTP":"NA",
"TIME":"2016-02-23 17:52:37"
}
]
}
However, when trying to iterate through it using JavaScript, the code is not executed. I have already searched extensively online for solutions without success. Any help would be greatly appreciated. Thank you!
function bringdata(){
$.ajax({
url:'report_entry.php',
type:"POST",
data:{nameV:$('#fq').val()},
async: false,
success: function(data){
$.each(data, function(i,post){
$("#magix").append("<li>+post.CODE+</li>");
});
}
});
}