开发者

How to send data from site to browser?

I'd like to send data to browser from server (website)开发者_运维问答.

For example on SO you receive notifications about new answers when answering a question.

Should I every n seconds send ajax queries to server, or there are better ways of doing this?

Is it possible to push data from server to browser?


The term of art for what you're trying to do is "Comet", and the wikipedia article on the subject explains many approaches to implement it -- not "push", really, but as close as you can get with HTTP and friends;-).


HTTP is pull-only, but you can keep a long-lived connection open in order to allow for streaming.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜