日期:2014-05-16 浏览次数:20846 次
function $(id){
return document.getElementById(id);
}
function createXMLHTTP(){
var xmlHttp=null;
try{
xmlHttp=new XMLHttpRequest(); }
catch (MSIEx){
try{
xmlHttp=new ActiveXObject("Msxml2.XMLHTTP"); }
catch (e){
try{
xmlHttp=new ActiveXObject("Microsoft.XMLHTTP"); }
catch(e){alert('您的浏览器不支持AJAX!');}
}
}
return xmlHttp;
}
function chk(){
var username=$('username').value;
var password=$('password').value;
if (username==""){
alert("请填写用户名!"); $('username').focus(); return false;
}
else if (password==""){
alert("请填写密码!"); $('password').focus(); return false;
}
var html
html="<!--登录状态显示.start-->"
html+="<!--登录状态显示.end-->"
$('msg').innerHTML=html;
//AJAX无刷新注册
var url="login.asp?username="+username+"&password="+password+"&t="+new Date().getTime();//每个时间的缓存解决
var x=createXMLHTTP();
x.open('GET',url,true)
x.onreadystatechange=function(){callback(x);}
x.send(null)
}
function callback(x){
if (x.readyState==4){
if(x.status==200||x.status==0){
var s=x.responseText;
if(s.length>0&&s=="YES"){
$('login').style.display="none";//隐藏注册DIV
$('msg').style.display="block";//显示信息DIV
}
else{
alert("您的帐号不存在或密码输入错误,请重新输入!!")
}
}
}
}
if session("xxx")="" then
response.write "0"
else
response.write "1"
end if