jQuery ajaxSend() 方法
實例
當 AJAX 請求即將發送時,改變 <div> 元素的內容:
$(document).ajaxSend(function(e,xhr,opt){
$("div").append("<p>Requesting: " + opt.url + "</p>");
});
定義和用法
ajaxSend() 方法規定 AJAX 請求即將發送時運行的函數。
注意:自 jQuery 版本 1.8 起,該方法只被附加到文檔。
語法
$(document).ajaxSend(function(event,xhr,options))
參數 | 描述 |
---|---|
function(event,xhr,options) |
必需。規定當請求成功時運行的函數。 額外的參數:
|