For the jquery form plugin http://jquery.malsup.com/form/#options-object, I see a success callback, but how do I run code if there is a failure like a network issue?
From the site:
Aside from the options listed below, you can also pass any of the standard $.ajax options to ajaxForm and ajaxSubmit
Presumably that means you could just add an "error" property with the function you'd like to execute upon error.
Looking at the plugin code that seems to be the case:
$.fn.ajaxForm = function(options) {
...
$(this).ajaxSubmit(options);
...
}
...
$.fn.ajaxSubmit = function(options) {
...
$.ajax(options);
...
}
'error' callback handler should be enabled:
"Note: Aside from the options listed below, you can also pass any of the standard $.ajax options to ajaxForm and ajaxSubmit." (http://jquery.malsup.com/form/#options-object)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With