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.
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?
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 09:10 PM.
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
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
I would recomend just reading some tutorials/books/articles etc on Ajax.
Here is a quick tutorial
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.
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Tags for this Thread