jQuery ajaxStart () method
Examples
When AJAX requests start to show "loading" the instructions:
$(document).ajaxStart(function(){
$(this).html("<img src='demo_wait.gif' />");
});
$(this).html("<img src='demo_wait.gif' />");
});
try it"
Definition and Usage
ajaxStart () method specifies AJAX request function runs at the start.
Note: Since jQuery version 1.8 onwards, this method is only attached to the document.
grammar
$(document).ajaxStart(function())
参数 | 描述 |
---|---|
function() | 必需。规定当 AJAX 请求开始时运行的函数。 |