I can easely use javascript to auto refresh the page every 10 sec for example but, isnt this going to overload the page having to ask for any change every 10 secons? is there a more efitient way to do this. Some body told me once than there is a way having the client side waiting for a response from the server that only sends it when it really has some change, for example some budy wrote a text in the chat. Is this really factible to do? is there a better way?.
Share
Why refresh a chat page? Why not just check the server to see if there are new posts/chats etc. If so, append those to your chat box.
Have your timer (setTimeOut) fire say ever 5 seconds:
Quick pseudo code:
Edit:
Seeing you have .NET I will assume you’re using ASP.NET. Here’s a link to a demo chat program:
http://trappedinhoth.blogspot.com/2009/04/ajax-jquery-chat-demo.html