events - Node.Js - letting users know someone is typing something -


i'm having chat app add imessage/facebook feature people know when each others typing something, changing name's color e.g.

i have tried :

$messagebox.keydown(function(){         if($(this).val().length!=0){ socket.emit('writing_message')};             });          socket.on('showing_writers',function(){         $users.html('');  // test if event received, not case...         }); 

i hoping way, everytime user presses letters, trigger basic event on server, respond :

socket.on('writing_message',function(){     io.sockets.emit('showing_writers', socket.nickname);     } 

socket.nickname contains user's nickname use find him on client's files, in order change name's color.

does know how in better way, , why i'm doing not working ?


Comments

Popular posts from this blog

java - activate/deactivate sonar maven plugin by profile? -

python - TypeError: can only concatenate tuple (not "float") to tuple -

java - What is the difference between String. and String.this. ? -