chibineku Posted October 19, 2009 Report Share Posted October 19, 2009 I made a very simple AJAX chat app, just for fun, and it relies on recursive setTimeouts to call the reload function. Obviously this is inefficient and is liable to have my hosting company ban me, so I was wondering if there is a more efficient way of detecting new messages and pushing them without having to just keep checking and make ajax calls or otherwise checking the database? Link to comment Share on other sites More sharing options...
justsomeguy Posted October 19, 2009 Report Share Posted October 19, 2009 You have to keep checking, HTTP doesn't have a way for the server to send a message to the browser without the browser having asked for it. Link to comment Share on other sites More sharing options...
chibineku Posted October 19, 2009 Author Report Share Posted October 19, 2009 Ah. Okie dokies. I thought as much but thought it was worth checking. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now