I'd recommend
Websockets. The idea is that the page contains JavaScript that connects to the server using Websockets, and assigns a function to handle the MessageEvents for that socket. That way, whenever the server sends something, that Javascript handler gets called.
See the link for further info, guides, and so on.