xmlHttp怎么在firefox下不能保存呀!
xmlHttp怎么在firefox下不能保存呀!
大家帮帮忙积分比较少了一点呀!
var xmlHttp = false;
try {
xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try {
xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
} catch (e2) {
xmlHttp = false;
}
}
if (!xmlHttp && typeof XMLHttpRequest != 'undefined') {
xmlHttp = new XMLHttpRequest();
}
xmlHttp.open("POST", "saveuser.asp", true);
xmlHttp.setRequestHeader('Content-type','application/x-www-form-urlencoded');
xmlHttp.onreadystatechange = saveuser;
xmlHttp.send("username="+escape(username)+"&password="+escape(password)+"&email="+escape(email)+"&truename="+escape
(truename)+"&sex="+escape(sex)+"&phone="+escape(phone)+"&mobile="+escape(mobile)+"&addr="+escape(addr)+"&province="+escape
(province)+"&addr="+escape(addr)+"&zip="+escape(zip)+"&age="+escape(age)+"&question="+escape(question)+"&answer="+escape
(answer)+"&oicq="+escape(oicq)+"&web="+escape(web));
}
}
function saveuser() {
if (xmlHttp.readyState < 4) {
d_username.innerHTML="loading…";
}
if (4==xmlHttp.readyState){
if (200==xmlHttp.Status){
var date=xmlHttp.responseText;
if (date==1){
alert("The user registers successfullyd!");
//window.location.href='\/exhibit';
window.location.href="/";
}else{
alert("User has been used, please replaced !");
window.location.href="register.asp";
}
}else{
alert("error");
}
}
}