Método jQuery ajaxStart()

❮ Métodos jQuery AJAX

Exemplo

Mostre uma imagem indicadora de "carregamento" quando uma solicitação AJAX for iniciada:

$(document).ajaxStart(function(){
  $(this).html("<img src='demo_wait.gif'>");
});

Definição e uso

O método ajaxStart() especifica uma função a ser executada quando uma solicitação AJAX é iniciada.

Nota: A partir da versão 1.8 do jQuery, este método só deve ser anexado ao documento.


Sintaxe

$(document).ajaxStart(function())

Parameter Description
function() Required. Specifies the function to run when the AJAX request starts

❮ Métodos jQuery AJAX