Created
March 11, 2014 19:57
-
-
Save yurifrl/9493772 to your computer and use it in GitHub Desktop.
submit form ajax (not Working)
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
// Reload types by AJAX POST | |
$form.submit(function (event) { | |
event.preventDefault(); | |
var data = $form.serialize(); | |
$.ajax({ | |
type: "POST", | |
url: form_action, | |
dataType: "json", | |
data: data, | |
success: function (json) { | |
alert("SUCCESS"); | |
}, | |
error: function (XMLHttpRequest, textStatus, errorThrown) { | |
console.log(XMLHttpRequest); | |
console.log(textStatus); | |
console.log(errorThrown); | |
return false; | |
} | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment