$.ajax('php/getTodos.php', { success: function(data, status, xhr) { let list = $.parseJSON(data) initList(list); } }); function initList(list) { $.each(list, function(index, value){ $('#todolist').append( '