Advertisement
Guest User

Untitled

a guest
Apr 6th, 2017
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.21 KB | None | 0 0
  1. $(document).ready(function(){
  2. $("#login_a").click(function(){
  3. $("#shadow").fadeIn("normal");
  4. $("#login_form").fadeIn("normal");
  5. $("#user_name").focus();
  6. });
  7. $("#cancel_hide").click(function(){
  8. $("#login_form").fadeOut("normal");
  9. $("#shadow").fadeOut();
  10. });
  11. $("#login").click(function(){
  12.  
  13. username=$("#user_name").val();
  14. password=$("#password").val();
  15. $.ajax({
  16. type: "POST",
  17. url: "login.php",
  18. data: "name="+username+"&pwd="+password,
  19. success: function(html){
  20. if(html=='true')
  21. {
  22. $("#login_form").fadeOut("normal");
  23. $("#shadow").fadeOut();
  24. $("#profile").html("<a href='logout.php' id='logout'>Logout</a>");
  25.  
  26. }
  27. else
  28. {
  29. $("#add_err").html("Usuario o password incorrectos");
  30. }
  31. },
  32. beforeSend:function()
  33. {
  34. $("#add_err").html("Cargando...")
  35. }
  36. });
  37. return false;
  38. });
  39. });
  40.  
  41. $("#add_err").html("Cargando...")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement