This is the basic implementation which will fix the client-side error report for you. On the server-side you can aggregate the errors and send them for analysis once a day or anything else that suits you.
To filter out error reports caused by browser plugins it is useful to check that the
scriptUrl origin is the same as your web page and that the url contains “.js”. Otherwise you will be overwhelmed with crash reports caused by failing plugins (especially in IE).
The latest [html5 Web API specification]((http://www.w3.org/html/wg/drafts/html/master/webappapis.html) for the error handler has one extra parameters - error object, but it seems like only Chrome is supporting it at this moment. The classic signature of the handler uses only
line, so be no surprised if the
column is undefined in older browsers. Also you can silence the error report in the script console in your browser if you
return true from the
onerror handler, but I would not recommend it unless you somehow manage to fix the error.
Here is a simple implementation: