我想遍历我的表中的行,并对每一行具有“警告”类的行发出一个 ajax 请求。到目前为止,这是有效的。
rows.each(function (i) {
    $.ajax({
        type: 'POST',
        url: 'ajax/Update/' + $(this).attr('rel'),
        success: function(c) {
            $('.table > tbody > tr.r[rel="' + c.Id +'"]').removeClass('warning').addClass('error');
        },
        dataType: "json",
        async:false
    });
});
类警告的删除和类错误的添加只会在主函数结束时显示。有没有办法在.each我设置类的那一刻更新循环中的页面内容?我也想更新一个进度条,但是当函数完成时它只是跳到 100%,而不是像每行的 20%。