Remote execution of client code from the server

When creating browser applications for Pick applications, people frequently ask how they can execute some code on the PC/client with instructions from the server. We do this all the time with terminal emulators in our “thick client” user interfaces. But what about doing this with a browser?