UPDATE: The example code was removed by requirement from Azure IoT Hub team, and they do not like users to connect to IoT Hub from browsers (https://github.com/Azure/azure-iot-sdk-node/issues/112#issuecomment-338073636).
Sorry for the broken links in this answer.
It seems this is an old question, however, I find there is still nobody can give the right answer.
In short, is there a way to read IoT Hub D2C messages in browser? The answer is absolute YES!
You shouldn't use RESTful API to loop checking messages, but use AMQP over WebSockets.
Before you start, you must know that IoT Hub has two sides, Device side and Service side. For Device side, you connect to IoT Hub using HTTP, AMQP and MQTT, however, for Service side you can ONLY connect to IoT Hub using AMQP.
Fortunately, Red Hat had already written a AMQP over WebSockets Node module, and you can do some simple work to make it working in browser.
You can learn more about the AMQP Node module from https://github.com/grs/rhea.
Also, we've made a web based tool for receiving D2C messages https://iotdevtool.com/service/, you can learn more about it from https://blogs.msdn.microsoft.com/zhiqing/2017/03/16/connect-to-azure-event-hub-in-browser-using-amqp-over-websockets/.