日期:2014-05-16  浏览次数:20837 次

XMLHttpRequest对象status=0 - Web 开发 / Ajax
status=0 真的是本地响应成功吗 ?
我怎么感觉不是啊 ! 那本地响应不成功是什么呢?

------解决方案--------------------
0跟http请求里面的200相同,参见
https://developer.mozilla.org/En/Using_XMLHttpRequest
------解决方案--------------------
The status attribute must return the result of running these steps: 

1、If the state is UNSENT or OPENED return 0 and terminate these steps. 

2、If the error flag is true return 0 and terminate these steps. 

3、Return the HTTP status code. 





------解决方案--------------------
未通过服务器返回成功执行返回的状态为0,如果找不到请求的文件会出错~~

通过服务器访问的返回http协议定义的状态,如404找不到,200成功执行等。。