tags:

views:

21

answers:

2

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?

+1  A: 

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

Ignacio Vazquez-Abrams
+1  A: 

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;-).

Alex Martelli