Possible Duplicate:
JavaScript Exception Handling
I have a web application where 100% of the javascript code executes as jQuery event handlers (I guess most jQuery apps are like this).
The question is how can I define a global exception handler. That is, if a function that is called when any exception that happens within any jQuery event handler goes uncaught (whether it is onload, click, a succesfull ajax call, an ajax error, whatever). My function would receive the error info (exception, stacktrace, whatever).
Clarification: I don't mean globally catching in ajax problems generated by the server or network, but globally catching problems that are due to (presumably) bugs in our code.