Skip to content

Instantly share code, notes, and snippets.

@RimonEkjon
Forked from singpolyma/ajax-form.js
Created August 26, 2014 04:13
Show Gist options
  • Save RimonEkjon/59d2c2f9c65e39eeb386 to your computer and use it in GitHub Desktop.
Save RimonEkjon/59d2c2f9c65e39eeb386 to your computer and use it in GitHub Desktop.
$('#thing form').submit(function(e) {
var $this = $(this);
e.preventDefault();
$.ajax({
type: this.method,
dataType: "JSON",
url: this.action,
data: $this.serialize(),
success: function() {
// Display success message or something
}
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment