为什么jQuery的支持,超时不同步的Ajax调用? [英] Why don't synchronous ajax calls in jquery support timeout?

查看:113
本文介绍了为什么jQuery的支持,超时不同步的Ajax调用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在读这里 jQuery中唐的同步Ajax调用 T时间了。

I was reading here that synchronous ajax calls in jquery don't time out.

这是一个技术上的限制,或者只是一些作者不喜欢支持?在桌子底下居然会发生什么,当一个Ajax调用是同步的?

Is this a technical limitation, or just something the authors didn't feel like supporting? What actually happens under the table when an ajax call is synchronous?

推荐答案

浏览器处理通过 XMLHtt prequest 的API,但是它不具有一个内置的超时功能。 JQuery的实现在JavaScript中它自己的超时浏览器XHR API之上。

The browser handles synchronous/asynchronous requests via the XMLHttpRequest API, but it does not have a built-in timeout feature. JQuery implements its own timeout in JavaScript on top of the browser XHR API.

由于同步调用阻止所有运行脚本,JQuery的超时不起作用。从理论上讲,它似乎是同步超时将是可能的,如果他们在浏览器级实现,而不是对JS水平

Since a synchronous call blocks all running scripts, the JQuery timeout does not work. In theory, it seems like synchronous timeouts would be possible if they were implemented at the browser level, as opposed to the JS level.

这篇关于为什么jQuery的支持,超时不同步的Ajax调用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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