views:

46

answers:

2

Just wondering how does ExceptionHub http://www.exceptionhub.com/ track the javascript errors in the user's browser?

A: 

You can learn by reading the code: http://js.exceptionhub.com/javascripts/eh.js

lowellk
That doesn't look too useful. :)
casablanca
Try this: http://jsexplorer.com/beautify/script?src=http://js.exceptionhub.com/javascripts/eh.js
lowellk
A: 

I haven't used this product before, but by looking at what they have to offer, here's my guess at how it works: the tracking script probably scans through the page on which it is installed and wraps all JavaScript code that it can find (for eg. inside <script> tags or in handlers such as onclick) in try-catch blocks, and when an exception occurs, it gains control and does whatever it's supposed to do, eg. reporting the exception.

casablanca