hold ajax calls -> need logic assist!
Posted: Mon May 07, 2012 10:03 pm
hey guys,
i working on a chat system and i have it so that if you start typing a msg it will say "the username is typing a msg.."
and how i do this is check with keydown command with javascript and run the a ajax call for php code, but the problem
i'm having is that it's printing out the msg 1000 times over and over when u press even one button and i need to implement
a control to handle the events, the way i could do it is to check if it's true that the user is typing and "remember it" and then
delete from memory sort of when user stop typing so that way it won't call for a new output every time cause it will know
if your still typing and it's holding the true value.
So what i ask for is help with building the control for the event just point me in the right direction.
Thanks guys!
i working on a chat system and i have it so that if you start typing a msg it will say "the username is typing a msg.."
and how i do this is check with keydown command with javascript and run the a ajax call for php code, but the problem
i'm having is that it's printing out the msg 1000 times over and over when u press even one button and i need to implement
a control to handle the events, the way i could do it is to check if it's true that the user is typing and "remember it" and then
delete from memory sort of when user stop typing so that way it won't call for a new output every time cause it will know
if your still typing and it's holding the true value.
So what i ask for is help with building the control for the event just point me in the right direction.
Thanks guys!