Skip to content

Instantly share code, notes, and snippets.

@sdkester
Created November 19, 2010 03:03
Show Gist options
  • Save sdkester/706072 to your computer and use it in GitHub Desktop.
Save sdkester/706072 to your computer and use it in GitHub Desktop.
// prepare the form when the DOM is ready
$(document).ready(function() {
// Setup the ajax indicator
$('body').append('<div id="ajaxBusy"><p><img src="images/loading.gif"></p></div>');
$('#ajaxBusy').css({
display:"none",
margin:"0px",
paddingLeft:"0px",
paddingRight:"0px",
paddingTop:"0px",
paddingBottom:"0px",
position:"absolute",
right:"3px",
top:"3px",
width:"auto"
});
});
// Ajax activity indicator bound to ajax start/stop document events
$(document).ajaxStart(function(){
$('#ajaxBusy').show();
}).ajaxStop(function(){
$('#ajaxBusy').hide();
});
@ivanrodri
Copy link

nice thanks !

@dmiro
Copy link

dmiro commented Feb 10, 2016

great!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment