Add Javascript error logging script

The script captures Javascript errors raised by the
window.onerror event and sends them to the Errorception web
service for logging and analysis.