// Setting up a loading indicator using Ajax Events $( "#loading_indicator" ) .ajaxStart(function() { $( this ).show(); }) .ajaxStop(function() { $( this ).hide(); });