Skip to content

Instantly share code, notes, and snippets.

@chihebnabil
Last active August 31, 2016 14:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chihebnabil/e2380dc7093ae7af46212d923fc682df to your computer and use it in GitHub Desktop.
Save chihebnabil/e2380dc7093ae7af46212d923fc682df to your computer and use it in GitHub Desktop.
$(function () {
$('#my_form').on('submit', function (e) {
// prevent browser from submitting the form
e.preventDefault();
var $form = $(this);
$.ajax({
url: $form.attr('action'),
type: $form.attr('method'),
data: $form.serialize(),
success: function (response) {
//server responce
}
});
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment