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.

# VS.NET JavaScript debugging

Wednesday, August 09, 2006 12:31 PM by Onion Blog

# JavaScript VS.Net

Sunday, August 13, 2006 7:56 AM by Lazy Coder

"Add me to the growing list of people who are surprised and pleased to see the fantastic JavaScript...

# Javascript Debugging In VS 2003

Friday, September 01, 2006 8:34 AM by Unknown Tales From Kerem

Well as i surfed the web i came across this nice article: http://weblogs.asp.net/ssharrock/archive/2003/04/20/5875.aspx...

# re: JavaScript Debugging

Wednesday, July 11, 2007 1:40 PM by Glauber

Oh my God, that's simply wonderful!!!!

Thanks a lot

# re: JavaScript Debugging

Wednesday, August 15, 2007 9:40 PM by zhangtai

Excellent!!!! Thanks mate!

# re: JavaScript Debugging

Monday, August 20, 2007 2:14 AM by amar

i want to scripting dibugger

# re: JavaScript Debugging

Wednesday, October 10, 2007 4:04 PM by Abhishek

Just FYI: You can also use the keyword "stop" instead of "debugger" but once execution halts at stop you need to right click on any subsequent statements and say "Set as next statement". But anyway, i like "debugger" better.

cheers!

# re: JavaScript Debugging

Wednesday, November 28, 2007 2:20 AM by Sreekanth

yes this works well in my PC, but i could not do this in my Laptop.. any other way pls..do mention

# re: JavaScript Debugging

Friday, December 14, 2007 6:44 AM by Rajesh

Thanks,

Really , made me to know easily how do to debug javascript

# re: JavaScript Debugging

Wednesday, September 10, 2008 6:23 AM by Pradeep Kumar Verma

Java script debugger is present in .net-2005

Leave a Comment

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