You want a browser Javascript application that executes some remote process (say, a script), and then listens for messages broadcast by that remote process. How would you build this?
1) browser client can continually poll server (done through XMLHttpRequest object or an iframe)
2) server can send a response that stays open... the connection doesn't close and the server can send updates when ready.