Skip to content

Instantly share code, notes, and snippets.

@folmert
Created May 30, 2015 22:17
Show Gist options
  • Select an option

  • Save folmert/b3bed10afc32d1aef896 to your computer and use it in GitHub Desktop.

Select an option

Save folmert/b3bed10afc32d1aef896 to your computer and use it in GitHub Desktop.
// http://malsup.github.io/min/jquery.form.min.js
// <script type="text/javascript" src="{}jquery.form.min.js"></script>
function showRequest(formData, jqForm, options) {
var queryString = jQuery.param(formData);
jQuery(".afterSend").empty().html("sending...");
return true;
}
function showResponse(responseText, statusText, xhr, jQueryform) {
jQuery(".afterSend").empty().html(responseText);
}
function error() {
}
jQuery('formthis').on('submit', function(e) {
e.preventDefault();
jQuery(this).ajaxSubmit({
target: '.afterSend',
crossDomain: false,
beforeSubmit: showRequest,
success: showResponse,
error: error
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment