<script type="text/javascript">
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("GET","innerHTMl.xml", true);
xmlHttp.send(null);
}function handleStateChange() {
if(xmlHttp.readyState == 4) {
alert("hello");
if(xmlHttp.status == 200) {
alert("hello");
document.getElementById("results").innerHTML = xmlHttp.responseText;
}
}
}</script>
请问各位以上代码哪里出问题了 为什么xmlHttp.status =200的判断不通过
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("GET","innerHTMl.xml", true);
xmlHttp.send(null);
}function handleStateChange() {
if(xmlHttp.readyState == 4) {
alert("hello");
if(xmlHttp.status == 200) {
alert("hello");
document.getElementById("results").innerHTML = xmlHttp.responseText;
}
}
}</script>
请问各位以上代码哪里出问题了 为什么xmlHttp.status =200的判断不通过
解决方案 »
- 用MyEclipse 写JSP时,<font><p></p></font>警告
- struts2上传图片求教
- ibatis2.0的sqlmapclient不必关闭,为什么3.0的sqlsession需要关闭呢?
- 一个测试网页的工具是jar文件,调用后IE打不开网页,出现"400 Bad Request Bad filename"错误
- TOMCAT6的同时在线人数问题
- 跪求 weblogic 10.0数据连接池获取办法
- myeclipse 连接mysql 异常:java.sql.SQLException: Access denied for user 'root'@'local
- 求转"你好" 字符串为正确汉字的算法,谢谢
- 设计使用JSP技术的Web系统,使用什么样的设计工具和设计方法比较合适?
- 酒店房间预订线上线下怎样保持数据同步
- 一个重复提交的问题,请各位帮帮忙
- MyEclipse6.0
if(xmlHttp.status==200){
alert("success!");
} else if(xmlHttp.status==403){
alert("Access denied");
} else if(xmlHttp.status==404){
alert("Requested URL is not found");
} else {
alert("other error:"+xmlHttp.status);
}
}}