jQuery ajaxStart

This AJAXEvent ajaxStart registers a handler to be executed when the first Ajax request begins.

Whenever an Ajax request is about to be sent, jQuery checks whether there are any other outstanding Ajax requests. If none are in progress, jQuery triggers the ajaxStart event. Any and all handlers that have been registered with the .ajaxStart() method are executed at this time.

To observe this method in action, do the following

Add jQuery libs from CDN into head section in HTML page

Write few HTML tags into body section

Add ajaxComplete event into head section

The complete HTML page

 

data file

data
When the user clicks the element with class trigger and the Ajax request is about to begin, the log message is displayed.

Thanks for reading.

Output

ajaxStart

Leave a Reply

Your email address will not be published. Required fields are marked *

Time limit is exhausted. Please reload CAPTCHA.