Results 1 to 5 of 5
  1. #1
    Join Date
    Dec 2005

    AJAX simple chat


    if I knew the AJAX part of the code I'd be able to code something like this.... so what I am wanting to do is have a textarea that gets all messages from a message table... and on the right hand side a text area that shows all usernames in the chat window. On the bottom a long text field for the message entry. I know how to make this if I had some AJAX to do this.

    Can someone write AJAX to do this, and explain line by line for me?

    Thanks if you can!

  2. #2
    did you check your hosting terms and conditions first, vary often the chat scripts are prohibited

  3. #3
    Join Date
    Dec 2005
    yes I know that the host will allow this....

  4. #4
    You will need to setup a storage area (database or text file) for the messages.

    When a user types a message (ex "Hi There") and presses send, the javascript will request a page like /sendmsg.php?message=Hi+There . This page will store the message in the database or text file.

    Then every X seconds, the page will request the content of /getmessages.php - that will show the messages received in the last at least X seconds in text or XML. The javascript will parse that and then display it on the screen.

    This is all done using the HTTP Request object in javascript - the core of AJAX.

    There may be existing scripts to do this - try searching hotscripts.

    There are many AJAX tutorials out there, try search for them to learn it.

    If you want this done by someone, it probably won't come too cheap. Post in the ads/offers section if you want to hire someone.

  5. #5
    Join Date
    Feb 2006
    Lancashire, UK
    have you checked out Yshout?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts