Jump to content

basic chat


jwk811

Recommended Posts

im trying to build a simple 1 on 1 chat for site help between me and a potential customer... and also a chat where vistors can talk among eachother.. i know i have to use ajax and js and maybe asp.. what i need to figure out it how when someone sends the message, how do i make it appear on the other persons screen? am i supposed to add it to a db and then call it? I'm not sure just need a little help so i can get a gist of how I can go about doing this, and any further help as well... thanks!
Link to comment
Share on other sites

The clue is:
when enter a message to somebody, call a function to save the text message to the database so that other people can read the message.
On the other hand, u need to check the database for every period, if there's a new message, show the message on the page (You can show the message dynamically with DOM, and you can request the page without refresh all the page with Ajax).
Link to comment
Share on other sites

[quote](You can show the message dynamically with DOM, and you can request the page without refresh all the page with Ajax). [/quote]

How would I do that? Show the message.

Okay so when someone saves their message to the database that message needs to add to the list of the conversation that has already started so I could call for any new messages with AJAX like every few seconds somehow and if their is any new messages then I take that and add it to the list. I don't know how I could get the new messages and add it to the list.. could someone help me with that? Thanks!!
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.