Duplicate:
How would I go about logging errors in javascript? I can't wrap every line of javascript in try catch block.
I talking about the errors that for example in IE, would show an Error On page message and have the line and char the caused the error. If I can just figure out how to catch this error on the client side, I can just log the error on the server using an ajax call.