You can register a function to run on the start and stop of every jQuery ajax call, like this:
$(document).ajaxStart(function () {
$("#loading").show();
}).ajaxStop(function () {
$("#loading").hide();
});
Then you don't have to do anything on each actual ajax request, it'll automatically run. Just change #loading to whatever the id of your loader element is.