fix
This commit is contained in:
parent
1214f90ba4
commit
2912afe2a0
2 changed files with 4 additions and 4 deletions
|
@ -255,13 +255,11 @@ function submitFormAjax(e, success, error) {
|
|||
var myToast = new bootstrap.Toast(document.getElementById('toast-post-success'));
|
||||
myToast.show();
|
||||
// Run success function
|
||||
success()
|
||||
if (success) success()
|
||||
return true
|
||||
} else if (xhr.status >= 300 && xhr.status < 400) {
|
||||
window.location.href = JSON.parse(xhr.response)["redirect"]
|
||||
} else {
|
||||
// Run error function
|
||||
error()
|
||||
try {
|
||||
data=JSON.parse(xhr.response);
|
||||
var myToast = new bootstrap.Toast(document.getElementById('toast-post-error'));
|
||||
|
@ -275,6 +273,8 @@ function submitFormAjax(e, success, error) {
|
|||
myToast.show();
|
||||
return false
|
||||
}
|
||||
// Run error function
|
||||
if (error) error()
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue