Skip to content

Instantly share code, notes, and snippets.

@xexes
Forked from sdkester/gist:706072
Created July 3, 2014 18:47
Show Gist options
  • Save xexes/9df5b191566c0a93ab7b to your computer and use it in GitHub Desktop.
Save xexes/9df5b191566c0a93ab7b 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();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment