“Página de carregamento para toda a chamada AJAX no jQuery 3.3.1” Respostas de código

Página de carregamento para toda a chamada AJAX no jQuery 3.3.1

		$(document).ajaxStart(function () {
            $('#ajax-loading-image').css("display", "block");
        });
        $(document).ajaxStop(function () {
            $('#ajax-loading-image').css("display", "none");
        });
sajad.pro

como esperar até a solicitação de post jQuery ter sido feita

$.when(ajax1(), ajax2(), ajax3(), ajax4()).done(function(a1, a2, a3, a4){
    // the code here will be executed when all four ajax requests resolve.
    // a1, a2, a3 and a4 are lists of length 3 containing the response text,
    // status, and jqXHR object for each of the four ajax calls respectively.
});

function ajax1() {
    // NOTE:  This function must return the value 
    //        from calling the $.ajax() method.
    return $.ajax({
        url: "someUrl",
        dataType: "json",
        data:  yourJsonData,            
        ...
    });
}
Foolish Flatworm

Respostas semelhantes a “Página de carregamento para toda a chamada AJAX no jQuery 3.3.1”

Perguntas semelhantes a “Página de carregamento para toda a chamada AJAX no jQuery 3.3.1”

Mais respostas relacionadas para “Página de carregamento para toda a chamada AJAX no jQuery 3.3.1” em JavaScript

Procure respostas de código populares por idioma

Procurar outros idiomas de código