H
H
Httdientee2021-09-01 19:57:52
WordPress
Httdientee, 2021-09-01 19:57:52

Help with wordpress ajax?

jQuery(function($){
  $('#register-form .login-form__button').click(function(){
    $.ajax({
      url: '<?php echo admin_url( "admin-ajax.php" ) ?>',
      type: 'POST',
      data: 'action=register_account&nameAccount=' + $('#register-form input[name=user]').val() + '&emailAccount=' + $('#register-form input[name=lg]').val() + '&passwordAccount=' + $('#register-form input[name=psw]').val(), 
      success: function( data ) {
        alert( data );
      }
    });
  });
});


I send AJAX then I catch hooks in function.php, but when I send ajax itself I get
500 (Internal Server Error) I

insert the code after <?php wp_footer() ?>

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Artem Zolin, 2021-09-01
@artzolin

There was already such a question , and in Google for the request "ajax register wordpress" solutions are dark

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question