Waiting for AJAX response

Author: | Categories: Programming No Comments

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});
 });

Leave a Reply

Your email address will not be published.