...

View Full Version : IE ok,but FF not work



leoz2z
12-12-2007, 09:31 AM
my login.asp can't work in FF:(
JS:


function CheckForm()
{
.......
.......
var url = "Login.asp?action=check&checkcode="+checkcode.value+"&username="+ escape(username.value)+"&psw="+escape(psw.value);
xmlhttp.open("get",url,true);
xmlhttp.onreadystatechange = function()
{
if(xmlhttp.readystate == 4 && xmlhttp.status ==200)
{
message = xmlhttp.responseText;
//alert(message);
switch(message)
{
case "differentcode":
alert("wrong checkcode");
break;
case "erro_username":
alert("user doesn't exsit");
break;
case "erro_psw":
alert("wrong password");
break;
case "erro_lock":
alert("the user was lock");
break;
case "suc":
//alert("access login");
//top.window.location = '../Vote/Vote_manage.asp';
location.href="../Vote/Vote_manage.asp";
break;
default:
alert("servers out of work");
}
}
}
xmlhttp.send(null);
}
return false;
}

ASP:


if psw<>Rs("PassWord")then
response.Write("erro_psw")
response.End()
else
if Rs("lock") = 1 then
response.Write("erro_lock")
response.End()
end if
session("admin_name") = username
If AutoGet <>"" Then

Response.Cookies("MyCMSCookie")("AdminName")=Session("admin_name")

Response.Cookies("MyCMSCookie").Expires=Date()+365
Else
Response.Cookies("MyCMSCookie")("AdminName")=""
Response.Cookies("MyCMSCookie").Expires=Date()-1
End If
rs_u = conn.execute("update admin set LoginNum=LoginNum+1 where UserName='"&username&"'")
response.Write("suc")
end if
else
response.Write("erro_username")
response.End()
end if

HTML


<form name="login" method="post">
<button value="登 录" onClick="CheckForm();return false;">登 录</button>

leoz2z
12-12-2007, 09:45 AM
I know the reason now
because
if(xmlhttp.readystate == 4 && xmlhttp.status ==200)
must be
if(xmlhttp.readyState == 4 && xmlhttp.status ==200)
FF is more strict than IE



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum