AJAX(XmlHtt prequest)超时长度由浏览器 [英] AJAX (XmlHttpRequest) timeout length by browser
问题描述
我一直在网上淘试图找到一个直接的答案。有谁知道默认的超时长度由浏览器的AJAX请求吗?同一个版本,如果它的改变?
I've been scouring the web trying to find a straight answer to this. Does anyone know the default timeout lengths for ajax request by browser? Also by version if it's changed?
推荐答案
我不认为浏览器有一个超时AJAX,只有同步或异步请求;同步 - 首先冻结JavaScript执行,直至请求返回, 异步 - 不冻结JavaScript执行,它只是接受请求了执行流程,如果你有一个回调函数就会执行功能并行的运行脚本(类似于线程)
I don't think browsers have a timeout for AJAX, there is only synchronous or asynchronous requests; synchronous - first freezes the JavaScript execution until the request returns, asynchronous - does not freeze JavaScript execution, it simply takes the request out of the execution flow, and if you have a callback function it will execute the the function in parallel with the running scripts (similar to a thread)
**sync flow:**
running JS script
|
ajax
(wait for response)
|
execute callback
|
running JS script
**async flow:**
running JS script
|
ajax --------------------
| |
running JS script execute callback
这篇关于AJAX(XmlHtt prequest)超时长度由浏览器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!