title: how to update chat window with new messages
body: <pre><code>setInterval(function{
  
   //send ajax request and update chat window
  
  
  }, 1000)
  </code></pre>
  
  <p>is there any better way to update the chat with new messages? is this the right way to update the chat using setInterval?</p>