Skip to content

Instantly share code, notes, and snippets.

@RimonEkjon
Forked from mikhailov/ajax_defaults.js
Created August 26, 2014 03:39
Show Gist options
  • Save RimonEkjon/5f62144ccf36f795f54d to your computer and use it in GitHub Desktop.
Save RimonEkjon/5f62144ccf36f795f54d to your computer and use it in GitHub Desktop.
var spinner = $('#ajax-spinner');
$(document).ajaxSend(function() {
$('input[type=submit]').attr('disabled', 'disabled');
$('#warningBox').hide();
spinner.show()
}).ajaxStop(function() {
$('input[type=submit]').removeAttr('disabled');
spinner.hide()
});
$("form").submit(function(){
$('input[type=submit]').attr('disabled', 'disabled');
return true;
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment