Skip to content

Instantly share code, notes, and snippets.

@dongalor
Last active November 13, 2017 14:29
Show Gist options
  • Save dongalor/b553ff26e8d6a30368ff561be2ff7b68 to your computer and use it in GitHub Desktop.
Save dongalor/b553ff26e8d6a30368ff561be2ff7b68 to your computer and use it in GitHub Desktop.
$.ajax( {
type: 'POST',
url: 'http://localhost:1337/sendMail',
data: json,
dataType: 'json',
success: function () {
form.style.display = 'none';
},
error: function(jqXHR, textStatus, err) { //show error message
console.log('Error: '+textStatus+', err '+err);
},
fail: function( jqXHR, textStatus ) {
console.log( "Request failed: " + textStatus );
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment