$(function () { var htmlTask = '
  • {0}{1}{2}
  • '; $('#refreshTask').on('click', function () { var that = $(this); that.toggleClass('fa-spin'); $.bc({ url: Tasks.url, 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); $('.site-footer').footer(); } that.toggleClass('fa-spin'); } }); }).trigger('click'); });