Guest User

Untitled

a guest
Aug 21st, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. Checking username availability with ajax using jQuery
  2. //use ajax to run the check
  3. $.post("check_username.php", { username: username },
  4. function(result){ alert(result);
  5. //if the result is 1
  6. if(result == 1){
  7. //show that the username is available
  8. $('#username_availability_result').html(username + ' is Available');
  9. }else{
  10. //show that the username is NOT available
  11. $('#username_availability_result').html(username + ' is not Available');
  12. }
  13. });
Add Comment
Please, Sign In to add comment