Forum Moderators: coopster
I've been looking at putting together a really simple style chat room in php and AJAX and I got to thinking about event listeners. If I coded this in Flash say I could have an event listener update the chat for all users when a message is submitted as opposed to just whoever submitted this.
Would there be a way to do this in php without using a timer to constantly refresh the chat window? E.G if user1 posts a message, the php script knows a message has been posted and the view would update for users 1,2 and 3? I just can't get my head around how this could work...
If it has waited 20 seconds, you best send a <no message> response which starts a new request, to avoid browser timeouts.