Unfortunately, there is actually no cross-browser mechanism for transferring data from the server to the browser. For example, back in 1995, Netscape launched a push server technology that uses a special type of content - multipart / x-mixed-replace, but from what I understand, IE does not support it. WebSockets are new, but support is just coming out.
So, you are forced to use the tools at hand, which means that the client must ask the server if there is new data - a survey. The survey takes place in 2 variants: intermittent interrogation and long interrogation. When you poll at intervals, you simply make a request to the server every n seconds, requesting data. This is rather talkative (pardon pun) if there is no new data to return. This is what people think when you say "survey."
Another option, a lengthy survey, is similar to the fact that the client makes a request to the server to see if there is new data. But in this case, the server does not send a response until it has nothing to say. In this case, the client remains suspended to respond for an indefinite period of time. When the client ultimately receives the response, he analyzes the response and immediately makes another request, which will remain hanging until the data appears.
Both of these polling approaches consume a lot of HTTP resources, but if you want to use XHR, this is the only way to do this.
Warning about long polling: when working with long polling, it is important to make sure that all of your XHRs are started asynchronously, otherwise you will see a blockage in the browser user interface stream.
If you are not interested in using AJAX, you can always use the tried and tested IFRAME-this-never-ending download. In this case, you have an IFRAME with a chat log and another IFRAME that contains your message area. In this case, the server simply never closes the connection for the IFRAME, which contains the chat log. Instead, he simply continues to push chat messages into the body.