还有一些则多次报告就绪状态1。
查看正在处理的请求的就绪状态。
深入了解HTTP就绪状态。
如果重新启用,错误路径将回到就绪状态。
The faulty path will go back to ready status if you re-enable it.
HTTP就绪状态表示请求的状态或情形。
An HTTP ready state indicates the state or status of a request.
当一个请求到达时,任务开始进入就绪状态。
下面让我们首先来看一下HTTP就绪状态。
注意您必须在调用open之前来查看就绪状态。
Note that you've got to check the ready state before open is called.
如果接收到一个响应,那么请求对象会注册为就绪状态4。
If a response is received, the request object registers a ready state of 4.
首先,您需要学习在每种就绪状态下可能碰到的是哪种请求状态。
First and foremost, you need to learn at what state of a request you encounter each ready state.
另外,未初始化的就绪状态在实际的应用程序中是没有真正的用处的。
Furthermore, the uninitialized ready state is pretty useless in practical applications.
所有的文档和规范都强调,只有在就绪状态为4时数据才可以安全使用。
All of the documentation and specifications insist that it's only when the ready state is 4 that data is safe to use.
如果它很忙,您必须等待,直到它处于可以使用的就绪状态。
If it is busy, you must wait until it is available in the ready state.
例如,在使用Opera 8.5时,所显示的就绪状态情况就更加糟糕了。
For example, when using Opera 8.5, things are even worse with displayed ready states.
您也许期望任务就绪状态从0到1、2、3再到4,但实际上很少是这种情况。
You might expect to always see the ready state move from 0 to 1 to 2 to 3 to 4, but in practice, that's rarely the case.
比较好的做法是向用户提供一些反馈,说明在处于就绪状态3时,很快就会有响应了。
A better idea is to provide some feedback to the user that when the ready state is 3, a response is forthcoming.
您会看到就绪状态为3的响应在每个脚本、每个服务器甚至每个浏览器上都是不一样的。
You'll find that your responses in ready state 3 vary from script to script, server to server, and browser to browser.
而第四项也是最后一项必需的更改是使RMock模拟对象脱离记录状态转入就绪状态。
And the fourth and final change required is to bring the RMock mock object out of record state into ready state.
这个回调函数会运行多次——每次就绪状态都会改变——您可以看到每个就绪状态的警告。
Your callback function will run several times — each time the ready state of the request changes — and you'll see an alert for each ready state.
换句话说,服务器履行了请求(即HTTP就绪状态是4)但是没有返回客户机预期的数据。
In other words, the server fulfilled the request (meaning the HTTP ready state is 4), but is probably not returning the data expected by the client.
一个程序、任务或硬件设备在处于就绪状态时,只需要一个起动信号就开始工作。
A program, task, or hardware device that is in a ready condition needs only a start signal in order to begin operation.
与就绪状态类似,responsetext属性的值在整个请求的生命周期中也会发生变化。
Like the ready state, the value of the responseText property changes throughout the request's life cycle.
在Opera上,您永远都不会看到前两个就绪状态,而在Safari上则没有第一个(1)。
On Opera, you'll never get those first two ready states and Safari drops the first one (1).
要查看这种变化,请使用如 清单5所示的代码来测试请求的响应文本,以及它们的就绪状态。
To see this in action, use code like that shown in Listing 5 to test the response text of a request, as well as its ready state.
如果就绪状态为4,我们不仅要运行回调函数中的代码,而且还要在每次调用回调函数时都输出就绪状态。
Instead of only running code in your callback if the ready state is 4, just output the ready state every time that your callback is called.
请求的就绪状态发生变化时,req.onreadystatechange中指定的函数将被调用。
When the ready state of a request changes, the function specified in req.onreadystatechange is invoked. req.readystate contains one of the following status codes
然而,由于服务器对请求进行了应答,因此就绪状态就被设置为4(即使应答并不是请求所期望的也是如此)。
However, the ready state will be set to 4 since the server answered the request (even if the answer wasn't what you wanted or expected for your request).
如果您可以考虑各种就绪状态——并且理解了这些就绪状态在不同浏览器之间的区别——就可以快速调试应用程序了。
If you can account for the various ready states — and understand how they differ from browser to browser — you'll be able to debug an application quickly.
其中的第一点,即就绪状态,将在下一篇文章中详细讨论,您将进一步了解HTTP请求的阶段,可能比您设想的还多。
The first of these — ready states — is going to take up the bulk of the next article; you'll learn more about the stages of an HTTP request than you ever wanted to know.
其中的第一点,即就绪状态,将在下一篇文章中详细讨论,您将进一步了解HTTP请求的阶段,可能比您设想的还多。
The first of these — ready states — is going to take up the bulk of the next article; you'll learn more about the stages of an HTTP request than you ever wanted to know.
应用推荐