public
Created

  • Download Gist
example_ajax_form.js
JavaScript
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
$(this).submit(function(){
$.ajax({
type: 'POST',
url: $(this).attr('action'),
data: $(this).serialize(),
success: function(data, status, xhr){
my_function_goes_here(data);
},
error: function(data,status,xhr) {
console.log(xhr);
console.log(data.responseText);
}
});
return false;
});

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.