Is there any way to catch Javascript errors globally across the web application by writing some code in the master page?
+7
A:
You can use the onerror
event:
var oldOnError = window.onerror;
window.onerror = function()
{
alert('Something bad happened');
//Optionally...
oldOnError();
}
Greg
2009-09-04 12:45:18
I have just released code to help log JavaScript errors by sending error information to the server - http://www.thecodepage.com/post/JavaScript-Error-Notifications.aspx
Gabriel McAdams
2010-02-02 19:23:08