Skip to content

Instantly share code, notes, and snippets.

@meenie
Created April 6, 2011 03:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save meenie/905102 to your computer and use it in GitHub Desktop.
Save meenie/905102 to your computer and use it in GitHub Desktop.
/*
* Only the alert from the beforeSubmit callback is fired off.
* The reason I need to do this is so other $.ajax calls (not using the ajaxForm plugin) will also use the success callback
* I suppose if I use $(document).ajaxSuccess() it would work, but that's not the point.
* If you were to extend $.ajaxSettings on line 65 of your most recent version (2.68) it will work properly.
*/
$(function() {
$.ajaxSetup({
success: function() {
alert('Fire off Success callback for all Ajax Requests');
}
});
$('form').ajaxForm({
beforeSubmit: function() {
alert('Fire off ajaxForms beforeSubmit callback');
}
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment