Open an "endless" HTTP session in a hidden frame (or in another "pop-up" style window) and use that for communication back from the server. If you need to communicate to the server, do another POST.
The server connection sends back Javascript commands to the hidden frame that are executed as they arrive. There are some intricacies (batching commands for efficiency and the like) but those are the basics. It's actually pretty simple.
If that isn't sufficient, you can use a Java applet for two-way communication instead. It doesn't seem necessary, however.