Geeks With Blogs

News My Blog has been MOVED to
Michael Freidgeim's OLD Blog My Blog has been MOVED to

Some time ago I found debugging - Automatic feedback on JavaScript error - Stack Overflow.  
and the discussion has  links to
Logging JavaScript Errors To ASP.NET(Unfortunately the link to download in the post is broken).
and custom control to help log JavaScript errors by sending error information to the server
I’ve downloaded solution from When I wanted to include dll into my solution dependencies,  I decided to rename WebControls.DLL to more descriptive JSErrorNotifier.DLL.
I also decided to rename default namespace to be the same as DLL name.
It wasn’t a good idea, because control stopped to work. It took me some time and I had to call  StreamHelper.EnsureWebResourceValid function from my old post Check that embedded resource exist before calling ClientScript.RegisterClientScriptResource or GetWebResourceUrl
to do all consistent changes for namespace renaming.

Finally when I made control working again, I found that it doesn’t work in IE 9. After another half an hour of debugging I found that for my IE9 onerror event is not fired even for example from MS documentation
It worked on other browsers and on IE8, but on IE9 you need to disable script debugging in Internet Explorer (Tools, Internet Options, Advanced). The  same happens if IE9 changed to IE7 or IE8 mode.(Actually I’ve noticed that Developer Tools Browser mode IE7 or IE8 do not emulate correctly native script engine of older IE versions)

However native IE8 on XP fires onerror regardless if debugging is enabled or disabled.

I hope that not too many IE9 users with enabled debugging will have  JS errors in our application.

Posted on Wednesday, April 25, 2012 11:55 AM ASP.NET , CSS/DHTML/JavaScript | Back to top

Comments on this post: Log JavaScript errors to the server.

# re: Log JavaScript errors to the server.
Requesting Gravatar...
weird stuff for me, would not it be easier to leave at the client side?
Left by Martini recipes on Apr 25, 2012 11:58 PM

# re: Log JavaScript errors to the server.
Requesting Gravatar...
It's easier, but developers will never know, which errors the users are seeing.
Left by Michael freidgeim on Apr 26, 2012 10:35 PM

# re: Log JavaScript errors to the server.
Requesting Gravatar...
You might try out , it's a new tool we recently launched to take care of the clisntside exceptions. Works well so far. It supports mobile devices as well. Worth giving it a try.
Left by Dumitru Glavan on May 27, 2013 2:16 AM

Your comment:
 (will show your gravatar)

Copyright © Michael Freidgeim | Powered by: