Skip to content

Instantly share code, notes, and snippets.

@ThomasWallace
ThomasWallace / ajax-form.js
Last active December 11, 2015 23:58 — forked from havvg/ajax-form.js
jQuery(function($) {
$('form[data-async]').on('submit', function(event) {
var $form = $(this);
var $target = $($form.attr('data-target'));
$.ajax({
type: $form.attr('method'),
url: $form.attr('action'),
data: $form.serialize(),