﻿// JScript 文件

function loginCheck()
    {    
        var txUser = document.getElementById("txU");
        var txPass = document.getElementById('txP');
        if (txUser.value.trim() == "")
        {
            alert("请输入用户名!");
            txUser.focus();
            return false;
        }
        
        if (txPass.value.trim() == "")
        {
            alert("请输入密码！");
            txPass.focus();
            return false;
        }
        
        loginRegister(txUser.value.trim(), txPass.value.trim());       
    }
    
    
    
    
// 登陆
function loginRegister(UserName, Pass){
$.ajax({
			type:"post",
			url:"GetDataByAjax/LoginState.ashx",
			// timeout: 2000,
			data:"UserName="+UserName+"&Pass="+Pass,
			cache:false, 
			success:function(html){
			    
			 	if(html.toUpperCase() == "LOGINFALSE"){
			 	    alert("您输入的用户名和密码不匹配！");
			 	}
			 	if (html.toUpperCase() == "LOGINTRUE"){
			 	    window.location.href='Member/';
			 	}
			},
			error:function(){
				$("#ferr").html("服务器错误！"); 
				return false;
			}					
		});

} 
