Results 1 to 8 of 8

Thread: chatroom

  1. #1
    Join Date
    Apr 2008
    Posts
    21

    Unanswered: chatroom

    what is the best chatroom to have that is visible to pretty much any browser? also, how would you set up your database for the chatroom?

  2. #2
    Join Date
    Apr 2008
    Location
    West Sussex
    Posts
    19
    ajax chatroom, providing it works in all browsers.

    Table - Chat

    Fields:
    id
    user
    message
    date
    deleted = yes/no
    admin = yes/no

  3. #3
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    for an AJAX application to work the browser must support Javascript, and Javascript MUST be enabled

  4. #4
    Join Date
    Jan 2007
    Location
    Birmingham
    Posts
    6

    Arrow

    for it to be live, realtime chatting, it must have some form of client-side scripting or interactive object.

    it's either:
    • use javascript (ajax)
    • embed a java object
    • embed a flash object


    flash is the modern solution. even java.com uses flash on it's homepage

    see an example of a flash-powered internet relay chat (IRC) client here: http://bwdp.org/chat/ ...this site also gives you the code to embed the ircqnet flash client into your own website - just choose which chatroom u want and the code will be provided on that page.

    or if you really fancy your skills in hosting an IRCd IRC server and programming your own webpage-based flash client, good luck with it! let me know how it goes

  5. #5
    Join Date
    Apr 2008
    Posts
    21
    instead of java or flash, is there like a chat with html? pretty basic but gets the job done?

  6. #6
    Join Date
    Jan 2007
    Location
    Birmingham
    Posts
    6

    Lightbulb

    yes but it won't update until the user refreshes their page. if you want it to auto-refresh to collect any new messages every few seconds (this is how ajax works) it will need at least javascript in nearly every case.

    but having said that, i think i've just thought of a way - use a meta tag. for example:

    Code:
    <html><head><title>Chatroom (16:18:10)</title><meta http-equiv="refresh" content="15;URL=http://chatroom.net/"></head><body><p>person 1: blaa</p><p>person 2: blee</p></body></html>
    the page will reload in 15 seconds thanks to the meta tag... and may look like this:

    Code:
    <html><head><title>Chatroom (16:18:25)</title><meta http-equiv="refresh" content="15;URL=http://chatroom.net/"></head><body><p>person 1: blaa</p><p>person 2: blee</p><p>person 3: bluu</p><p>person 1: blabble</p><p>person 2: blee blee bloo</p></body></html>
    the page that refreshes doesn't have to be the whole page... it could just be an iframe that contains the messages.

    or maybe set it to auto-refresh every minute or two, and it will naturally refresh more often if the user pushes a submit button to post a message.

    thanks for making me think about it. i might just create a super-accessible chatroom like this in the near future

  7. #7
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    but are reloads necessarily a good use of bandwidth or a suitable design. I'd argue that AJAX, and similar environments are the way to..... that way round you are only reloading what you need, which makes the network impact much much lighter (less network traffic, less server traffic reloading duplicate data)

    I think it will be a pig to learn AJAX for an app like this, and unless you have got a very good development environment a pig to debug.. but in my books AJAX is the way to go.

    unless your chatroom is relatively small, and not changing every few seconds..... in which case a page reload may make sense.

    of course you could do a page reload inside a frameset.. but then we aren't supposed to be using framesets these days.... you'll get clobbered on the accessibility rankings and probably also will cause headaches for spiders
    I'd rather be riding on the Tiger 800 or the Norton

  8. #8
    Join Date
    Jan 2007
    Location
    Birmingham
    Posts
    6

    Arrow

    yes, to be honest i jhaven't got far into ajax yet, but in looking into it it does reload as i said, but not in the standard way. it uses some "http request get object" within javascript.....

    see: http://www.w3schools.com/Ajax/ajax_examples.asp

    ...this is certainly the way to go if you intend only to support javascript-enabled users.

    flash is good too.

    but the meta tag idea, with possible iframe, means it would work even without javascript or java or flash...etc

Posting Permissions

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