xhr.readystate === 4的含义是什么 [英] What is meaning of xhr.readystate===4

查看:1401
本文介绍了xhr.readystate === 4的含义是什么的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是说 AJAX 呼叫在xhr.readystate===4之后完成了吗?
此处表示状态为complete.那么complete是什么意思?

Is it right to say that the AJAX call has completed after xhr.readystate===4?
Here it says the state is complete. So what does this complete mean?

推荐答案

Ajax http请求具有5个状态作为您的参考文档:

An Ajax http request has 5 states as your reference documents:

0   UNSENT  open() has not been called yet.
1   OPENED  send() has been called.
2   HEADERS_RECEIVED    send() has been called, and headers and status are available.
3   LOADING Downloading; responseText holds partial data.
4   DONE    The operation is complete.

状态4表示已发送请求,服务器已完成返回响应,浏览器已完成了下载响应内容. 因此,可以说AJAX调用已完成.

State 4 means that the request had been sent, the server had finished returning the response and the browser had finished downloading the response content. So, it is right to say that the AJAX call has completed.

这篇关于xhr.readystate === 4的含义是什么的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆