Created
August 16, 2014 10:12
-
-
Save gorgogol/3428b20e7ba17a6f6a5f to your computer and use it in GitHub Desktop.
Posting a form with jquery.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jQuery(document).ready(function($){ | |
$('form#aForm').on('submit', function(e){ | |
e.preventDefault(); | |
$.post( | |
url: form.attr('action'); | |
data: form.serialize(), | |
success: function(data){ | |
// | |
}, | |
error: function(data){ | |
// | |
} | |
); | |
return false; | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment