How to make a real time - User is typing notice to all in chat
i want to make a script with jquery and php, A real time username "Evx" is typing a msg and show it to all real time.. like skype has a pen ../ and facebook has a notice when user types. and all other chats do as well.

what i need is some assistance with the logic steps and information on how to do this the easy way but still have it work as well as any other way.

    //time delay before ajax call
    var delay = (function(){
      var timer = 0;
      return function(callback, ms){
        clearTimeout (timer);
        timer = setTimeout(callback, ms);
      };
    })();
    
    <code>
        $('#usermsg').keydown(function(){
        if( $('#usermsg').val().length === 5) {
       delay(function(){
          $.ajax({
                            url: "addusertyping.php",
                            cache: false,
                            success: function(){   
                           
                    }
                    });
      }, 5000 );
      }
      });
    <code>
       $('#usermsg').keyup(function(){
      	 if( $('#usermsg').val().length >= 6) {
      	 	// here i should basically check for //an update from server or what not.
      	 	}
      });
    </code>

any help, assistance, notes, tutorials, link what ever that can be of some assistance
please tell me i would greatly appreciated it thank you in advance!
-Evx.

How to make a real time - User is typing notice to all in chat
===

i want to make a script with jquery and php, A real time username "Evx" is typing a msg and show it to all real time.. like skype has a pen ../ and facebook has a notice when user types. and all other chats do as well.

what i need is some assistance with the logic steps and information on how to do this the easy way but still have it work as well as any other way.

    //time delay before ajax call
    var delay = (function(){
      var timer = 0;
      return function(callback, ms){
        clearTimeout (timer);
        timer = setTimeout(callback, ms);
      };
    })();
    
    <code>
        $('#usermsg').keydown(function(){
        if( $('#usermsg').val().length === 5) {
       delay(function(){
          $.ajax({
                            url: "addusertyping.php",
                            cache: false,
                            success: function(){   
                           
                    }
                    });
      }, 5000 );
      }
      });
    <code>
       $('#usermsg').keyup(function(){
      	 if( $('#usermsg').val().length >= 6) {
      	 	// here i should basically check for //an update from server or what not.
      	 	}
      });
    </code>

any help, assistance, notes, tutorials, link what ever that can be of some assistance
please tell me i would greatly appreciated it thank you in advance!
-Evx.
