Question

A good example of what I want is a chat system, where I send a message to someone and he can instantly see my message and vice versa.

So I want the best way to track if in the database there is a new answer for me if yes then show it with AJAX.

Example Websites:

  1. Twitter
  2. Friend Feed
Was it helpful?

Solution

You probably want to look at Comet, or one of the other push technologies

OTHER TIPS

You could use AJAX, but if you have a limited audience or won't be going live for a while, you might want to look into HTML 5 Web Sockets (it's currently only supported by a few browsers). With it, you could open sockets to the browsers that want to chat. All messages will be relayed over the Web server, so the chatters won't be able to find out the IP address of another participant.

I've been looking for the answer to this question for ages. Thank you Steve. After some research I found http://www.webreference.com/programming/javascript/rg28/ who seems to do the trick

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top