javascript – Ajax简单的问题

我有一个关于ajax的非常简单的问题.

如果我想刷新我的网站的某个特定区域,我会使用ajax是最好的方法.

但是,无论如何都没有javascript定期检查服务器上的更改,服务器会在给定事件发生时发送数据吗?

我想要的是客户端不需要定期发送请求,而是服务器只会将信息发送给客户端,而客户端又会有某种事件监听器.

提前致谢

最佳答案 是的,这可以做到.它被称为“推送”或“推送流”.

这是一个提供此功能的网站:InstantPush.以及来自其主页的简短引用:

“InstantPush is used to make web pages
and mobile phones go live. They will
instantly be updated in real time when
a change occurs at the server side.
Standard web communication makes
updates pass firewalls and proxies.
Without any modules at the client
side!

InstantPush has been used since 2001,
before “Ajax was invented”. It is
probably the First Ajax Push
Framework.

InstantPush is leading the market in
northern Europe.”

这是另一家提供此技术的公司:LightStreamer.并在其主页上引用:

“Lightstreamer is a scalable and reliable Server for pushing live data to Rich Internet Applications

Based on the Comet and Real-Time Web
paradigms, it streams real-time data
to any Web browser and client
application. HTML, HTML5, AJAX, Flex,
Silverlight, Java, .NET, iOS, Android,
and BlackBerry applications, can
easily receive live data from
Lightstreamer Server.

Lightstreamer has been used in many
mission-critical production systems,
where scalability, low network impact,
bandwidth management, adaptive
streaming, and other advanced
features, have proven fundamental.”

点赞