Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $(document).ready(function(){
- $("#login_a").click(function(){
- $("#shadow").fadeIn("normal");
- $("#login_form").fadeIn("normal");
- $("#user_name").focus();
- });
- $("#cancel_hide").click(function(){
- $("#login_form").fadeOut("normal");
- $("#shadow").fadeOut();
- });
- $("#login").click(function(){
- username=$("#user_name").val();
- password=$("#password").val();
- $.ajax({
- type: "POST",
- url: "login.php",
- data: "name="+username+"&pwd="+password,
- success: function(html){
- if(html=='true')
- {
- $("#login_form").fadeOut("normal");
- $("#shadow").fadeOut();
- $("#profile").html("<a href='logout.php' id='logout'>Logout</a>");
- }
- else
- {
- $("#add_err").html("Usuario o password incorrectos");
- }
- },
- beforeSend:function()
- {
- $("#add_err").html("Cargando...")
- }
- });
- return false;
- });
- });
- $("#add_err").html("Cargando...")
- <div id="add_err">
- <img src="nuestra_animacion.gif" />
- </div>
- //Es script después del ready
- $('#add_err').hide();
- //En la linea para mostrar tu mensaje de cargando lo cambiarías por esto
- $('#add_err').fadeIn(1000);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement