Guest User

Untitled

a guest
Oct 16th, 2018
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. $(document).ready(function(){
  2. $("#box-login").submit(function() {
  3.  
  4. $.ajax({
  5. type : 'POST',
  6. url : '/Single/safebox/php/login_vai.php',
  7. dataType : 'json',
  8. data : {
  9. username : $('#username').val(),
  10. password : $('#password').val()
  11. },
  12. success : function(data){
  13. alert(data);
  14.  
  15. if(data == '0')//if aphp return value "0"
  16. { alert ("0");
  17. $("#content-login .error").show();
  18. }
  19. else if(data == '1')//if it returns "1"
  20. { alert ("1");
  21. $("#content-login .error").hide();
  22. }
  23.  
  24. }
  25. });
  26. })
  27.  
  28. });
Add Comment
Please, Sign In to add comment