首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > Ajax >

XMLHttpRequest对象status=0

2012-02-21 
XMLHttpRequest对象status0 - Web 开发 / Ajaxstatus0 真的是本地响应成功吗 ?我怎么感觉不是啊 ! 那本

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成功执行等。。

热点排行