JavaScript/PHP script to send JavaScript errors to the server and log them