How do I display json data in a list using jQuery?
$(document).ready(function() {
$.getJSON('example.json', function(data) {
$.each(data.example, function(key, value) {
var output="";
output="<li>" + data.example[key].name + "</li>";
$('#example').append(output);
});
});
}
This doesn't seem to display anything.
example? can you show us your HTML? - Also, you do have the file'example.json'placed on the folder as your HTML, right? (and you are using a server to ask for this file, right?)