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.
精彩评论