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

jQuery ajaxStart() method

jQuery ajaxStart() method

jQuery AJAX methods jQuery AJAX methods

Example

Display a "loading" indicator when an AJAX request starts:

$

(

document

)

.

ajaxStart

(

function

(

)

{

$

(

this

)

.

html

(

"

"

)

;

}

)

;

Try it »


Definition and Usage

The ajaxStart() method specifies a function to run when an AJAX request starts.

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


Syntax

$(document).ajaxStart(

function())

Parameters Description
function() Required. Specifies the function to run when an AJAX request starts.

jQuery AJAX methods jQuery AJAX methods