jQuery API jQuery API 中英文对照版
ajaxSend(callback)
ajaxSend(callback)

绑定一个Ajax请求发送时执行的函数。

返回值:jQuery

参数:

  • callback (Function): 用于执行的函数。

示例:

AJAX请求发送时显示一条信息

("#msg").ajaxSend(function(request, settings){
   $(this).append("<li>Starting request at " + settings.url + "</li>");  
 }); 
 
ajaxSend( callback )

Attach a function to be executed before an AJAX request is sent.

The XMLHttpRequest and settings used for that request are passed as arguments to the callback.

Return value: jQuery
Parameters:

  • callback (Function): The function to execute.

Example:

Show a message before an AJAX request is sent.

 $("#msg").ajaxSend(function(request, settings){
     $(this).append("<li>Starting request at " + settings.url + "</li>"); 
 });  
相关链接
asp之家 | jQuery官方网站 | jQuery中文网 | 电子书作者网站 | 电子书作者blog