SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    Guru in training bronze trophy SoulScratch's Avatar
    Join Date
    Apr 2006
    0 Post(s)
    0 Thread(s)

    Javascript chatroom

    Has anyone attempted to code a chat room before? I'm wondering how it would be possible.

    Here are some ways I can think of doing it, would appreciate advice..

    1) Create a mini blog, with a simple server-side language and database just to enter messages, and then display them. Then take that and use XHR to send a request every _ seconds on window.setTimeout to pull messages from the database..

    2) Using simple files and JSON as an alternative to a database. I'm not familiar at all with JSON though, and if this would have any benefits over the database.
    Last edited by SoulScratch; May 5, 2008 at 20:50.

  2. #2
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Christchurch, New Zealand
    104 Post(s)
    4 Thread(s)
    The database is great when you aim to store the information for later.
    JSON is more suitable for easily working with the information in a structured manner from javascript.
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript


Posting Permissions

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