weixin_33701564 2016-11-28 06:18 采纳率: 0%
浏览 50

ajax请求没有停止

Here is my ajax call:

 $.ajax({
                        url: "AutoRFQ_Vendors_ST.aspx/BindVesselGrid",
                        type: "POST",
                        timeout: 3000,
                        data: JSON.stringify(sendingdata),                  
                        contentType: "application/json",
                        success: function (data) {
    //do something
    }

Here is my CSS loader:

  ajaxStart: function () { $body.addClass("loading"); },
            ajaxStop: function () { $body.removeClass("loading"); }

When I make an ajax call which responds d:'' an empty string but my ajaxstop: event is not firing.

  • 写回答

2条回答 默认 最新

  • 斗士狗 2016-11-28 06:21
    关注

    You have to hide your loader on ajax() complete like:

    ajax({
        complete: function(){
            $body.removeClass("loading");
        }
    });
    

    complete executes after either the success or error callback were executed.

    评论

报告相同问题?