﻿var xmlHttp; 
function createXMLHttpRequest() { 
if (window.ActiveXObject) { 
xmlHttp = new ActiveXObject("Microsoft.XMLHTTP"); 
} 
else if (window.XMLHttpRequest) { 
xmlHttp = new XMLHttpRequest(); 
} 
} 
function startRequest() { 
createXMLHttpRequest(); 
xmlHttp.onreadystatechange = handleStateChange; 
xmlHttp.open("POST", '/user/userLogin.aspx?LoginId='+document.getElementById("LoginId").value + "&LoginPass=" + document.getElementById("LoginPass").value, true); 
xmlHttp.send(null); 
} 
function handleStateChange() { 
if(xmlHttp.readyState == 4) { 
if(xmlHttp.status == 200) { 
  if(xmlHttp.responseText=="true")
  {
     //alert("登陆成功!");
     window.location.href="http://"+window.location.host+"/user/index.aspx";
  }
  else
  {
     document.getElementById("LoginPass").value="";
     alert("对不起，用户名或密码错误！"); 
  }
  } 
 } 
} 