JavaScript Debugging

I've recently been asked to review a few of the ASP.NET 3rd party controls that provide the very rich client-side user experience. One such control is Infragistic's UltraWebGrid2. While this control is really quite nice, there is the need to include some of your own JavaScript to utilize the control to its fullest extent. In this process I was reminded why I stopped working on web front-ends a few years before ASP.NET: the frustration of trying to debug JavaScript.
 
But now -- WOW -- Visual Studio.NET comes thru with flying colors. Just two simple steps to client-side debugging nirvana.
  1. Clear the "disable script debugging" checkbox in Internet Explorer's advanced properties.
  2. Add the keyword "debugger" somewhere within your JavaScript.
When you run the web page from Visual Studio in debugging mode, viola--when it hits the "debugger" statement, the Visual Studio debugger window takes control, you can set your break points, and proceed as normal. You can even get very clever setting the "debugger" from within script created from you server-side code that's registered with one of the many "Register" client-side script block methods.
Published Sunday, April 20, 2003 7:44 AM by shark

Comments

# re: JavaScript Debugging

Thursday, October 30, 2003 11:12 AM by Thats a great help
I use netscape to debug javascript and started cursing Microsoft before aspx pages are not well rendered in other browsers.

Now, Microsoft has my full praises...and you too....

Thank you

# re: JavaScript Debugging

Wednesday, March 10, 2004 12:12 PM by Don Robins
Hunted this up as I was trying to get the @#$@ script debugger to fire up and couldn't remember the 'debugger;' statement. Solved my problem, then realized it was your article. I should have just called you directly. <g>

# re: JavaScript Debugging

Tuesday, March 30, 2004 12:43 AM by Sucha
You saved my day !! Thanks a lot indeed.

Leave a Comment

(required) 
(required) 
(optional)
(required)