AJAX请求可以保持开放以进行多个响应吗? [英] Can an AJAX request be left open for multiple responses?

查看:70
本文介绍了AJAX请求可以保持开放以进行多个响应吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




对于多个

响应,AJAX请求是否可以保持打开状态?这可以避免重复轮询服务器。


谢谢,

彼得

Hi,

Is it possible for an AJAX request to be left open for multiple
responses? This could avoid repetitive polling of the server.

Thanks,
Peter

推荐答案

pe**********@gmail.com 在2006年4月13日下午11:29说:
pe**********@gmail.com said the following on 4/13/2006 11:29 PM:


是否可以为多个
响应保持开放的AJAX请求?这可以避免重复轮询服务器。
Hi,

Is it possible for an AJAX request to be left open for multiple
responses? This could avoid repetitive polling of the server.




你试过吗?


-

Randy

comp.lang.javascript常见问题 - http:// jibbering。 com / faq &新闻组每周

Javascript最佳实践 - http://www.JavascriptToolbox .com / bestpractices /



Did you try it?

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/




Randy Webb写道:

Randy Webb wrote:
pe ********** @ gmail.com 在4/13/2006 11:29 PM说了以下内容:
pe**********@gmail.com said the following on 4/13/2006 11:29 PM:


对于多个
响应,AJAX请求是否可以保持打开状态?这可以避免重复轮询服务器。
Hi,

Is it possible for an AJAX request to be left open for multiple
responses? This could avoid repetitive polling of the server.



你试过吗?



Did you try it?




这段代码是肯定的吗?我没试过。我甚至都不知道我会在哪里开始。


彼得



Is this code for yes? I haven''t tried. I don''t even know where I would
begin yet.

Peter



pe**********@gmail.com napisal(a):

pe**********@gmail.com napisal(a):


对于多个
响应,AJAX请求是否可以保持开放状态?这可以避免重复轮询服务器。


首先,UA'或AJAX使用的HTTP协议是

请求/响应*协议(*不需要响应) - 所以对于一个

请求只能做一个响应 - HTTP 1.1增强(例如

持久性和流水线操作)发生在幕后......并且来自
AJAX(XmlHttpObject)中的
无法启用/禁用

(仅限浏览器设置 - 启用HTTP 1.1协议。

从我的观点来看看来这里有点问题这样的通用
Hi,

Is it possible for an AJAX request to be left open for multiple
responses? This could avoid repetitive polling of the server.
First of all, the HTTP protocol which is used by UA''s or AJAX is
request/response* protocol (* response is not required) - so for one
request only one response can be done - the HTTP 1.1 enhancements (like
persistence and pipelining) happens behind the scenes... and from
within AJAX (XmlHttpObject) there is no way to enable/disable that
(only from browser setting - enabling HTTP 1.1 protocol.
From my point of view there is little point to ask here such generic



问题......如果你问的问题更多,你会得到更好的答案

具体。


最好的问候

Luke M.


question... you will get better answers if problems you ask is more
concrete.

Best regards
Luke M.


这篇关于AJAX请求可以保持开放以进行多个响应吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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