Jump to content

Instant Messaging Function


FARGORE
 Share

Recommended Posts

On some sites there will be an instant message functionality where everyone on the same page can type messages and everyone will see it populate as soon as the message is submitted. My question is what is the best way of programming the auto update functionality for the message system. I had considered using an on change state with a function call to time. In theory if this worked the system would use AJAX and repopulate the message box based on the current information on the database every second. If one person typed something within one second all the browsers would update their message boxes and apply the update. I had also considered that you could use a Listener but I’m not to knowledgeable on them yet. So any suggestions on the best way of having a web site that updates in real time based on the input from multiple users? Thank you everyone for the help and have a great day.

Edited by FARGORE
  • Like 2
Link to comment
Share on other sites

Sending an AJAX request every few seconds is a common technique.Alternately, you can use a Flash or Java client on your page and communicate with a listener on the server. That's far more complicated to implement.

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...