Created
April 28, 2015 12:43
-
-
Save Bouhnosaure/91fc6863313e938b0533 to your computer and use it in GitHub Desktop.
Post a form
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
$( ".contact-form" ).on( "submit", function( event ) { | |
event.preventDefault(); | |
$.ajax({ | |
type: "POST", | |
url: $( this ).attr('action'), | |
data: $( this ).serialize(), | |
dataType: "json", | |
success: function(data) { | |
alert('tout est ok !'); | |
}, | |
error: function(){ | |
alert('oups erreur :o'); | |
} | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment