How to call .ajaxStart() on specific ajax calls

前端 未结 10 822
孤独总比滥情好
孤独总比滥情好 2020-11-28 03:47

I have some ajax calls on the document of a site that display or hide a progress bar depending on the ajax status

  $(document).ajaxStart(function(){ 
              


        
10条回答
  •  -上瘾入骨i
    2020-11-28 04:23

    There is an attribute in the options object .ajax() takes called global.

    If set to false, it will not trigger the ajaxStart event for the call.

        $.ajax({
            url: "google.com",
            type: "GET",
            dataType: "json",
            cache: false,
            global: false, 
            success: function (data) {
    

提交回复
热议问题