$(function () { var htmlTask = '
  • {0}{1}{2}
  • '; $('#refreshTask').on('click', function () { var that = $(this); that.toggleClass('fa-spin'); $.bc({ url: Tasks.url, autoFooter: true, callback: function (result) { if (result) { var content = result.map(function (task) { return $.format(htmlTask, task.TaskName, task.UserName, task.AssignTime, task.Id); }).join(''); $('#list-task').html(content); } that.toggleClass('fa-spin'); } }); }).trigger('click'); });