Last active
August 22, 2016 10:14
-
-
Save ferdiunal/e026db140ced7d8183102f581f2477ac to your computer and use it in GitHub Desktop.
This file contains hidden or 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
const DATA = $(formId).serialize(); | |
const URL = $(formId).attr('action'); | |
$.ajax({ | |
url: URL, | |
data: DATA, | |
success: function (e) { | |
alertify.success('Tamamdır :)') | |
}, | |
error: function (e) { | |
const data = e.responseJSON; | |
if(e.status){ | |
switch(e.status){ | |
case 422 : | |
const captcha = data['g-recaptcha-response']; | |
if (typeof captcha !== 'undefined') { | |
grecaptcha.reset(); | |
} | |
break; | |
} | |
} | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment