Ajax Events

Contact Us or call 1-877-932-8228
Ajax Events

Ajax Events

Often, you'll want to perform an operation whenever an Ajax requests starts or stops, such as showing or hiding a loading indicator. Rather than defining this behavior inside every Ajax request, you can bind Ajax events to elements just like you'd bind other events. For a complete list of Ajax events, visit http://docs.jquery.com/Ajax_Events.

Creating a Loading Indicator Using Ajax Events

$('#loading_indicator')
	.ajaxStart(function() { $(this).show(); })
	.ajaxStop(function() { $(this).hide(); });
Note: the $.fn.ajaxStart and $.fn.ajaxStop functions are not invoked for JSONP requests.
Next