Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Dec 2007
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    IE ok,but FF not work

    my login.asp can't work in FF
    JS:
    Code:
    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:
    Code:
    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
    Code:
    <form name="login" method="post">
    <button  value="登 录" onClick="CheckForm();return false;">登 录</button>

  • #2
    New to the CF scene
    Join Date
    Dec 2007
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •