jquery做的登陆 点一次点击登陆按钮没反应 第二回正常登入

jquery做的登陆 点一次点击登陆按钮没反应 第二次正常登入
RT:
不是经常发生的问题  十次有俩次
账号 密码 验证码 都输入无误  点击登陆按钮  没有登入  登陆页面刷了一下
再次输入账号 密码 验证码 就能正常登入  
$().ready(function () {
    if ($('#username').val() == "")
        $('#username').focus();
    else
        $('#password').focus();
    $('#Login').click(function () {
        if ($('#username').val() == "") {
            document.form1.username.focus();
            alert("账号不能为空!");
            return false;
        } 
        else if ($('#password').val() == "") {
            document.form1.password.focus();
            alert("密码不能为空!");
            return false;
        } 
        else if ($('#chktxt').val() == "") {
            document.form1.chktxt.focus();
            alert("验证码不能为空!");
            return false;
        } 
        else if ($('#chktxt').val().toLowerCase()  != $('#Hidden1').val().toLowerCase()) {
            document.form1.chktxt.focus();
            document.form1.chktxt.select();
            alert("验证码输入错误!");
            return false;
        } 
        else {
            $.ajax({
                type: "POST",
                url: "ajax/login.ashx",
                data: "username=" + escape($('#username').val()) + "&password=" + escape($('#password').val()) + "&chktxt=" + escape($('#chktxt').val()),
                success: function (msg) {
                    if (msg == "success") {
                        window.location = "index.html";
                    }
                    if (msg == "fail") {
                        alert('帐号或密码错误!!!');
                        return false;
                    }
                },
                error: function (XMLHttpRequest, textStatus, thrownError) {
                }
            });
        }
    });
});

------解决方案--------------------
window.location = "index.html";
==>
alert("成功登陆...");
location.href="index.html";
------解决方案--------------------
引用:
Quote: 引用:

window.location = "index.html";
==>
alert("成功登陆...");
location.href="index.html";
可为什么十次里有八次是正常第一次点击登陆按钮就能正常登入呢?


你先确定能不能进入到这里先