AJAX waiting indicator

The following code snippet will display a waiting indicator during any AJAX request.

[code lang=”js”]
//Adds a wait indicator to any ajax requests
$(‘body’).ajaxStart(function() {
$(‘#loading’).show();
});
$(‘body’).ajaxStop(function() {
$(‘#loading’).hide();
});
[/code]

This entry was posted in Code and tagged , , , .

Post a Comment

You must be logged in to post a comment.