JS in a separate file

Trying to fix the problem with the chat not loading