refresh chat with javascript