我有这样一段JS代码,在火狐下面运行正常没事,但是在IE下就报JS错误,说拒绝访问,也就是$get()方法过不去,请问这是什么原因,该如何解决? if (rlt == '1') {
var userName = document.getElementById("TB_Account").value;
if (userName == "" || userName == null) {
return;
} else {
$.get("http://192.168.0.188:120/shortcut/reg.aspx?par=" + userName + "&ab=" + Math.random(), function (result) {
alert("返回值:" + result);
//如果已注册
if (result == 1) {
notice.className = "log_fx";
// aWritenResult = "0";
return false;
}
//如果未注册
else if (result == 0) {
notice.className = "log_fh";
// aWritenResult = "1";
return true;
}
else { notice.className = "log_fx";
// aWritenResult = "0";
return false;
}
});
}
}
var userName = document.getElementById("TB_Account").value;
if (userName == "" || userName == null) {
return;
} else {
$.get("http://192.168.0.188:120/shortcut/reg.aspx?par=" + userName + "&ab=" + Math.random(), function (result) {
alert("返回值:" + result);
//如果已注册
if (result == 1) {
notice.className = "log_fx";
// aWritenResult = "0";
return false;
}
//如果未注册
else if (result == 0) {
notice.className = "log_fh";
// aWritenResult = "1";
return true;
}
else { notice.className = "log_fx";
// aWritenResult = "0";
return false;
}
});
}
}
可以参考这个看下。
http://www.cnblogs.com/cfanseal/archive/2009/05/19/1460382.html