<script language="javascript">
function test1(form){ 
if(form.Name.value == "admin" && form.password.value == "admin")
{
alert(a+"欢迎回来:"+form.Name.value);
window.location.href="index.html"; 
}
else{
alert("请填正确的用户名!"); 
form.Name.focus(); 
return (false); 
}
}
</script>window.location.href="index.html"; 
怎么无法实现跳转?S.O.S

解决方案 »

  1.   

    <script language="javascript">
    function test1(form){ 
    if(form.Name.value == "admin" && form.password.value == "admin")
    {
    alert("欢迎回来:"+form.Name.value);
    window.location.href="index.html"; 
    }
    else{
    alert("请填正确的用户名!"); 
    form.Name.focus(); 
    return (false); 
    }
    }
    </script>上面有一点小错,看这个。window.location.href="index.html";
    无法实现跳转??
    哪里错了?window.location.href="index.html";
    写在
    function test1(form){}上面就没问题
    为什么写在
    function test1(form){}的判断里就不行了呢?