是否有任何理由使用同步XMLHtt prequest? [英] Is there any reason to use a synchronous XMLHttpRequest?
问题描述
这似乎是最每个人都异步请求与XMLHtt prequest但很明显的事实,那就是做同步请求的能力表示有可能是一个有效的理由这样做。那么,什么可能的正当理由是什么?
It seems most everyone does asynchronous requests with XMLHttpRequest but obviously the fact that there is the ability to do synchronous requests indicates there might be a valid reason to do so. So what might that valid reason be?
推荐答案
我认为他们可能变得像HTML 5标准的进展情况更受欢迎。如果Web应用程序被赋予访问多个线程,我可以用一个专门的线程进行同步的请求预见开发商,乔纳森说,为确保前另一个请求发生。随着一个线程的现状,这是一个不太理想的设计,因为它阻止,直到请求完成。
I think they might become more popular as HTML 5 standards progress. If a web application is given access to multiple threads, I could foresee developers using a dedicated thread to make synchronous requests for, as Jonathan said, to ensure one request happens before another. With the current situation of one thread, it is a less than ideal design as it blocks until the request is complete.
这篇关于是否有任何理由使用同步XMLHtt prequest?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!