Client-Side Javascript Error Recording
Adrian K. writes a fantastic article about how to integrate XML, AJAX, and C to create an error catching system. The short story, in their words, goes: “It’s kind of scary realizing that should your JavaScript fail, the only way you’ll know is if some kind user lets you know. We’ve all seen “object x is undefined” errors and so on, how many times have you reported the error to the webmaster? It’s easy for these problems to go unnoticed for prolonged periods of time.
I have recently been getting to grips with ‘AJAX’ techniques, and had a magic light-bulb moment when I realised that by using a combination of AJAX and C#, we can do away with reliance on users, and log the errors automatically ourselves.
The basic plan of attack is as follows:
- Catch the client side JavaScript error. Encapsulate it in XML.
- Send it to the server via an XmlHttpRequest (AJAX)
- Catch the XmlHttpRequest on the server by using a .Net HttpHandler.
- Save the error information to a database, file or email.”
Read the full detailed instructions through the Code Project Network
