S
S
Schoolboy.2015-09-23 13:31:56
PHP
Schoolboy., 2015-09-23 13:31:56

How to fulfill a JavaScript condition?

What should be written in success, so that if the auth2.php file returns 1, then the page would be updated.

$(document).ready(function(){
    
      $('#myForm').submit(function(){
        $.ajax({
          type: "POST",
          url: "auth2.php",
          data: "phone="+$("#phone").val(),
          success: 
        });
        return false;
      });
      
    });

Answer the question

In order to leave comments, you need to log in

1 answer(s)
L
Lander, 2015-09-23
@viphorizon

success: function(response) {
 if (response.data == '1') {
  window.location.reload();
 }
}

Didn't check, but something like that.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question