Communication from the mbed to a web page is achieved with RPC, Remote Procedure Calls. JavaScript running in the webpage will either call an RPC function to perform an mbed process or will access an RPCVariable in order to read a variable resident on the mbed.
In my case I included the RPCInterface library. This library has the following API's: