If New to Ajax or only know the field , "polling" concept may allow you to feel scared. Unfortunately, polling is the only solution. To client and server set up a row between the pipes, at the same time at the two ends do not need to install specific software, implementation does not yet exist for this purpose can be cross-platform, cross-browser method. Even so, may also be necessary to carry out specialized configuration of the firewall before it can work. Therefore, if everyone is required can be a simple approach, Ajax and the poll is the only possibility.
But continued to publicize and advocate the "real-time" Where is it? Polling can not be real-time. This really true? I think it depends on your definition of real-time. I have prepared electrophysiology data retrieval code, real-time means that the ms. I believe, in some cases, geologists put hours, days or even years as a real-time.
If access to Wikipedia, that is, will find that the average human reaction time at around 200-270 milliseconds. That is, hit the first ball of time. Read a message and the response time to form much longer, even if you are into. Therefore, waiting for a chat message, about 200 milliseconds (which may be a little longer) time should be sufficient. I set to one second, but did not feel uncomfortable.