jQuery ajaxSend () method
Examples
When about to send AJAX requests, change the content <div> element:
$(document).ajaxSend(function(e,xhr,opt){
$("div").append("<p>Requesting: " + opt.url + "</p>");
});
$("div").append("<p>Requesting: " + opt.url + "</p>");
});
try it"
Definition and Usage
ajaxSend () method specifies a function to run when an AJAX request to be sent.
Note: Since jQuery version 1.8 onwards, this method is only attached to the document.
grammar
$(document).ajaxSend(function(event,xhr,options))
参数 | 描述 |
---|---|
function(event,xhr,options) |
必需。规定当请求成功时运行的函数。 额外的参数:
|