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