www.webdeveloper.com
Results 1 to 6 of 6

Thread: Trigger an Event on Client Side

Hybrid View

  1. #1
    Join Date
    Aug 2008
    Posts
    31

    Trigger an Event on Client Side

    Hi, what I'm trying to do is make a page so that if someone does something it is live on everyones page thats viewing it and vice-versa. So for example, if there's a text box and I type something, it shows what I'm typing while I type it, to anyone who is viewing that page. And if someone else types I'll be able to see it. If thats too unclear let me know, I'll try to explain it better.

    Thanks!

  2. #2
    Join Date
    Jan 2009
    Posts
    6
    AJAX.. sorta like in a chat system where it automatically checks for new im's, only this one would check for new keystrokes. For example, on meebo, when someone is typing a message, it says .. ____________ is typing or w/e. Same concept, although instead of giving that message, you would show what is being typed. etc. Sounds like it might bog down the program though. Why do you need this?

  3. #3
    Join Date
    Aug 2008
    Posts
    31
    The typing was just an example, but what I want to make is a chess clock, where there is two countdowns (which I already made) next to each other. And when some one else on another computer clicks on their own clock it stops theirs and starts mine and vice versa. I can get the clocks to do that on the same computer but I need to be able to have both computers see and work it at the same time. If its easier to make two pages with one clock on each then that would be even better.
    Last edited by bholtiphone; 01-23-2009 at 08:10 PM.

  4. #4
    Join Date
    Jan 2009
    Posts
    6
    AJAX, i think. You just need to have a loop running ajax calls to the server checking to see if the clock has been stopped.

    When they click stop, you run an AJAX call that has the server side store that the clock has been stopped, then both the clients will automatically detect if the clock has been stopped. Same process for both clocks

  5. #5
    Join Date
    Aug 2008
    Posts
    31
    Can you give me a link to a sample script or on how to do this? Because I don't know any AJAX or how to use it

  6. #6
    Join Date
    Jan 2009
    Posts
    6
    I would recomend just reading some tutorials/books/articles etc on Ajax.

    Here is a quick tutorial
    http://swik.net/Ajax/How+to+use+XMLHttpRequest

    if you scroll down, that XHConn looks pretty easy to do, but it will pretty difficult to implement if you don't read about what AJAX is to understand what exactly you are doing with it. Google is your best friend.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

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



Recent Articles