how to retrieve json data that was converted from a php numical array using jquery? I have this php numical array….
while(tests < totalResults)
{
$testResults[$columnIndex] = '<p>' . $log_info . '</p>';
}
$jsonData = json_encode($testResults);
echo $jsonData;
This is how I retrieve the above php code using jquery but not outing anything…
$.getJSON("test.php",function(data)
{
$.each(data, function(key, value)
{
$("#test li:eq(0)").appendTo(value[key]);
});
});
The
valueparameter is not the array, it’s the value from that item of the array.Note that you are creating elements from the string in the array, adding a child to them, and throwing them away. Perhaps you want to use the
appendmethod instead.