jQuery ajaxComplete () method
Examples
Show "loading" indication when the AJAX request is in progress:
$(document).ajaxStart(function(){
$("#wait").css("display","block");
});
$(document).ajaxComplete(function(){
$("#wait").css("display","none");
});
$("#wait").css("display","block");
});
$(document).ajaxComplete(function(){
$("#wait").css("display","none");
});
try it"
Definition and Usage
ajaxComplete () method specifies AJAX request functions run when completed.
Note: Since jQuery version 1.8 onwards, this method is only attached to the document.
Unlike ajaxSuccess (), () function method prescribed will run when the request is completed by ajaxComplete, even if the request was not successful.
grammar
$(document).ajaxComplete(function(event,xhr,options))
参数 | 描述 |
---|---|
function(event,xhr,options) |
必需。规定当请求完成时运行的函数。 额外的参数:
|