Closed mgersten-caxy closed 11 years ago
I tried to keep to your code style, please let me know if anything needs fixing.
Hold on, this doesn't quite work yet...
Two things: The id could be a problem as it is very generic. Maybe we should prefix it or give it a less common name at least. And second, the reason why I used setTimeout instead of the setInterval is, that when the server responses very slow, it will get fired with more and more requests if you use setInterval. With the current approach, more requests will only be send if a response arrived first.
Ok, I think I've fixed both issues and it seems to work for me now.
Ok, I think I've addressed your issues. I rebased on your latest copy and also fixed another bug I found. Is this good now?
Is there anything else you need from me for this?
sorry for the delay! thanks a lot for your pull request!
This PR uses jQuery to post the message and update the listing. I pulled the setTimeout function out of the updateChat function so that I can call it after the post. If I would've left it in there, you end up with multiple interval refreshes. Also changed from setTimeout to setInterval since it's no l longer recreating the timeout each call now.