Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

jQuery ajaxSend() method

jQuery ajaxSend() method

jQuery AJAX methods jQuery AJAX methods

Example

Change when an AJAX request is about to be sent

element's content changes:

$

(

document

)

.

ajaxSend

(

function

(

e

,

xhr

,

opt

)

{

$

(

"

div

"

)

.

append

(

"

Requesting:

"

opt

.

url

"

"

)

;

}

)

;

Try it »


Definition and Usage

The ajaxSend() method specifies a function to run just before an AJAX request is sent.

**Note:** As of jQuery version 1.8, this method is attached only to the document.


Syntax

$(document).ajaxSend(

function(event,xhr,options))

Parameters Description
function(event,xhr,options) Required. Specifies the function to run when the request succeeds.
 额外的参数:       

 
  • event - Contains the event object
  • xhr - Contains the XMLHttpRequest object
  • options - Contains the options used in the AJAX request
  • |

    jQuery AJAX methods jQuery AJAX methods