$(document).ready(function () { getData(); }); function getData() { $.ajax({ type: 'GET', url: uri, success: function (data) { $('#todos').empty(); getCount(data.length); $.each(data, function (key, item) { var checked = ''; if (item.isComplete) { checked = 'checked' } $('