jQuery ajaxStart () Método
Exemplos
Quando solicitações de AJAX começar a mostrar "carregamento" as instruções:
$(document).ajaxStart(function(){
$(this).html("<img src='demo_wait.gif' />");
});
$(this).html("<img src='demo_wait.gif' />");
});
tente »
Definição e Uso
ajaxStart () método especifica função de pedido de AJAX é executado no início.
Nota: Desde jQuery versão 1.8 em diante, este método só é anexada ao documento.
gramática
$(document).ajaxStart(function())
参数 | 描述 |
---|---|
function() | 必需。规定当 AJAX 请求开始时运行的函数。 |