I have a registration form, after filling it in and sending it starts loading ajax, that is, it fills in the database, it is registered, but it does not show ajax, it hangs only if it reloads the page into the user page.

Here is the script code

$(".signup-form").ajaxForm({ url: SK_source() + "?t=register", beforeSend: function() { signup_form = $(".signup-form"), signup_button = signup_form.find(".submit-btn"), signup_button.attr("disabled", !0), signup_form.find(".post-message").fadeOut("fast"), SK_progressIconLoader(signup_button) }, success: function(e) { 200 == e.status ? window.location = e.redirect_url : (signup_button.attr("disabled", !1), 0 == signup_form.find(".post-message").length ? signup_form.find(".signup-error-text").after('<div class="post-message hidden">' + e.error_message + "</div>").end().find(".post-message").fadeIn("fast") : signup_form.find(".post-message").html(e.error_message).fadeIn("fast")), SK_progressIconLoader(signup_button) } }) 

but php handler

enter image description here

enter image description here

  • You can attach a code and rephrase, please, a question ... - Denis Lazarev
  • When sending, ajax hangs, and php handles everything. There should work a redirect, but for some reason it does not work - Gaioz
  • And what does the ajax request return? What data? - Ivan Bolnikh
  • Nothing. Even the error does not display - Gaioz
  • @David Develop check whether something comes to $ _POST - Denis Lazarev

1 answer 1

Why you don’t have an error handler? Perhaps the server does not return a 200 error. Therefore, add another callback for error and see the answer in the browser (chrome tools -> Network)

 $(".signup-form").ajaxForm({ url: SK_source() + "?t=register", beforeSend: function() { signup_form = $(".signup-form"), signup_button = signup_form.find(".submit-btn"), signup_button.attr("disabled", !0), signup_form.find(".post-message").fadeOut("fast"), SK_progressIconLoader(signup_button) }, success: function(e) { 200 == e.status ? window.location = e.redirect_url : (signup_button.attr("disabled", !1), 0 == signup_form.find(".post-message").length ? signup_form.find(".signup-error-text").after('<div class="post-message hidden">' + e.error_message + "</div>").end().find(".post-message").fadeIn("fast") : signup_form.find(".post-message").html(e.error_message).fadeIn("fast")), SK_progressIconLoader(signup_button) }, error: function(e) { //смотрите здесь ошибку } 

})