Waiting for AJAX response
Below code will fade out all elements in a web page till AJAX completion of request.
$("body").ajaxSend(function()
{
$(this).append('<div id="loading">Data Loading</div>');
$('#tag').children().not('#loading').css({'opacity':0.22});
});
$("body").ajaxComplete(function()
{
$("div#loading").remove();
$(#tag).children().not('#loading').css({'opacity':1});
});