jQuery ajax - ajaxSend() 方法
實例
當 AJAX 請求即將發送時,改變 div 元素的內容:
$("div").ajaxSend(function(e,xhr,opt){ $(this).html("Requesting " + opt.url); });
定義和用法
ajaxSend() 方法在 AJAX 請求開始時執行函數。它是一個 Ajax 事件。
語法
.ajaxSend([function(event,xhr,options)])
參數 | 描述 |
---|---|
function(event,xhr,options) |
必需。規定當請求開始時執行函數。 額外的參數:
|
詳細說明
XMLHttpRequest 對象和設置作為參數傳遞給回調函數。