I can't seem to get this working, i am retrieving some json data, and just trying to loop through it an append it to a DIV. here is my code:
HOW THE JSON IS RETURNED (PHP)
{"list":[{"subscribe":"example"},{"subscribe":"example2"},{"subscribe":"example3"},{"subscribe":"example4"},{"subscribe":"example5"}]}
MY JSON CALL USING JQUERY
$.getJSON("article.php",function(data)
$.each(data.list, function(i,data) {
var listData = "<li>" + data.subscribe + "</li>";
$('#lists').append(listData);
});
});
I am not retrieving any errors in the console, but nothing is happening, i know the call is successful, am i doing the .each loop correctly? can anyone please help?
console.logbefore your iterative loop to see whatdatais returned?