这段代码如何改 本帖最后由 lyhjc_2016 于 2014-11-23 22:41:57 编辑 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 function check_login(form){var user = form.user.value; var pwd = form.pwd.value; if(user == ""){ alert('用户名不允许为空'); form.user.focus(); return false; } if(pwd == ''){ alert('密码不允许为空'); form.pwd.focus(); return false; }var xmlhttp;if (window.XMLHttpRequest){xmlhttp=new XMLHttpRequest();}else{xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");}var url = "check_login.php?"; xmlhttp.open("POST",url,true); xmlhttp.onreadystatechange = function checklogin(){ if(xmlhttp.readyState == 4){ if(xmlhttp.status == 200){ var msg = xmlhttp.responseText; if(msg == "1"){ alert('登录成功'); location=('main.php'); }else{ alert('用户名或密码错误!'); alert(msg); } } }};xmlhttp.send("user="+user+"&pwd="+pwd);} jquery播放器 真棒 短息发送 this的理解。 call,apply用法 ActiveX控件返回一个从IUnknown继承的接口怎么在Js中调用这个接口的方向 js中如何操作数组?添加多个元素 CSDN中未找到答案的关于JAVASCRIPE特效与数据库的超难问题,请高手帮忙解决,100分 100分!!!!!! 这个简单代码打开缺少对象?请教!!! 请教一个捕获鼠标事件的问题!多谢了。 用javascript控制图片淡入淡出效果 [求助]arcgis js调用天地图服务问题 谷歌浏览器下 js window.open打开弹出新窗口后, 如何关闭父窗口窗口
var user = form.user.value;
var pwd = form.pwd.value;
if(user == ""){
alert('用户名不允许为空');
form.user.focus();
return false;
}
if(pwd == ''){
alert('密码不允许为空');
form.pwd.focus();
return false;
}
var xmlhttp;
if (window.XMLHttpRequest){xmlhttp=new XMLHttpRequest();}else{xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");}
var url = "check_login.php?";
xmlhttp.open("POST",url,true);
xmlhttp.onreadystatechange = function checklogin(){
if(xmlhttp.readyState == 4){
if(xmlhttp.status == 200){
var msg = xmlhttp.responseText;
if(msg == "1"){
alert('登录成功');
location=('main.php');
}else{
alert('用户名或密码错误!');
alert(msg);
}
}
}
};
xmlhttp.send("user="+user+"&pwd="+pwd);
}