Just to point out I'm referring to chat systems written in PHP/jQuery where you see at the bottom 'User is typing a message...' I've tried so many methods to accomplish it but all fail, I built my own chat system written in PHP + MySQL/Ajax + jQuery.
I'm not asking for someone to write the function for me but just to give me a little example so I can get an idea of what to do.
I would greatly appreciate it, thanks in advance :)
Use a timer to send an AJAX request onkeyup
that tells the database the user is typing, on the other side when your pulling down chat messages you can then notify the other person that they are typing.
Take a look at doTimeOut which has a great example of debouncing in javascript...
http://benalman.com/code/projects/jquery-dotimeout/examples/debouncing/
You could to try check if your message textbox is filled with something every n seconds. If so, fire an server request to update that status between both users.
Using JavaScript check every (lets say) 2 seconds if any key is pressed at chat window. If yes, then send an Ajax request to tell your application that user is typing something.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With