This handler function was then assigned to the onreadystatechange property.
然后把这个事件处理函数分配给onreadystatechange属性。
Notice that we registered a handler (by setting the req. onreadystatechange property).
注意,我们注册了一个处理程序(通过设置req .onreadystatechange属性)。
The server looks at the onreadystatechange property and figures out what method to call.
服务器查看onreadystatechange属性确定要调用的方法。
The secret revolves around a simple property of XMLHttpRequest called onreadystatechange.
秘密就在于XMLHttpRequest的一个简单属性onreadystatechange。
Internet Explorer 7 calls back to onreadystatechange a lot — and I mean a lot, even on small requests.
InternetExplorer7对onreadystatechange进行多次回调——我的意思是说即使对小的请求也多次进行回调。
The snippet in Listing 3 shows an example of a typical incarnation of the onreadystatechange callback function.
清单3中的代码片段显示了onreadystatechange回调函数的典型实例化示例。
As I show in Listing 3, all the XMLHTTPRequest object provides is a callback mechanism called onreadystatechange.
正如我在清单3中展示的一样,XMLHTTPRequest对象所提供的全部内容是一个名为onreadystatechange的回调机制。
You parse the document in the onreadystatechange function of the XMLHttpRequest object used to make the Ajax call.
您解析用于进行Ajax调用的XMLHttpRequest对象的onreadystatechange函数中的文档。
This new code just looks to see whether the request object has changed in response to this onreadystatechange callback.
这个新代码只是查看请求对象是否发生改变,以响应onreadystatechange回调。
If a callback function is provided, this function sets the onreadystatechange property of the XHR object to that callback function.
如果提供了回调,那么这个函数将XHR对象的onreadystatechange属性设置为这个回调函数。
The only other important thing to note is the callback function, or, the closure created for the request's onreadystatechange function.
除此之外,惟一需要注意的是回调函数,或者为请求的onreadystatechange函数创建的闭包。
Earlier, I said that the server, once finished with a request, looks up what method to call in the onreadystatechange property of XMLHttpRequest.
前面提到,服务器在完成请求之后会在XMLHttpRequest的onreadystatechange属性中查找要调用的方法。
Each time the readystate changes, the readystatechange event fires and the handler function attached via the onreadystatechange property is called.
每次readystate变化时,readystatechange事件就触发,由onreadystatechange属性指定的事件处理函数就被调用。
In such cases, you need to override the onreadystatechange function of the XMLHttpRequest instance so that you can set a callback function for the asynchronous request.
在这种情况下,需要覆盖XMLHttpRequest实例的onreadystatechange函数以便您可以为这个异步请求设置一个callback函数。
Make sure that when you set up your request, you set the callback function to updatePage ; to do this, set the onreadystatechange property of your request object to updatePage .
确保在建立请求时,将回调函数设置为updatepage;要实现这种设置,可以将请求对象的onreadystatechange属性设置为updatepage 。
You've already seen how to let the server know what to do when it's finished: Set the onreadystatechange property of the XMLHttpRequest object to the name of the function to run.
现在我们已经看到如何告诉服务器完成后应该做什么:将XMLHttpRequest对象的onreadystatechange属性设置为要运行的函数名。
It gives a degree of control to the server, as well; when the server finishes a request, it looks in the XMLHttpRequest object and specifically at the onreadystatechange property.
它也给了服务器一定程度的控制权,当服务器完成请求之后,会查看XMLHttpRequest对象,特别是onreadystatechange属性。
Calling abort on a successfully completed request won't do anything and onreadystatechange is set to an empty function just in case the browser gets a delayed response for an old request.
在成功完成了的请求上调用abort不起任何作用,并且仅当浏览器收到一个对旧请求的延时响应的情况下,onreadystatechange才被设置为一个空函数。
Calling abort on a successfully completed request won't do anything and onreadystatechange is set to an empty function just in case the browser gets a delayed response for an old request.
在成功完成了的请求上调用abort不起任何作用,并且仅当浏览器收到一个对旧请求的延时响应的情况下,onreadystatechange才被设置为一个空函数。
应用推荐