Feb 10 2007

How to step through Javascript with the Visual Studio debugger

Category: Tips and TricksJoeGeeky @ 21:57

The other day I overheard a conversation related to not being able to “debug” javascript in Visual Studio 2005.  This is a common problem and something that is actually really easy to do.  If you are thinking you don't need this, then think again.  Even if you are not writing Javascript for your projects, open source tools such as the AJAX Control Toolkit and the many third party controls inject javascript at runtime.  From time-to-time these can generate nebulous Javascript errors that can be really hard to trace down.  With that in mind, this is what you do...

In the IE Options Menu, find the option Disable Script Debugging and clear the checkmark next to it.  Assuming you are on a system with Visual Studio 2005 installed, the next time one of your pages generates a javascript error, you will be prompted to start an instance of the VS Debugger and will be able to see the code, step through it, see variable values, etc...

If you have Javascript in your project in the form of a .js file, you will be able to set break points just like you would do in code behind. 

This is really easy, and really powerful so give it a shot and enjoy...  As a side note, leaving Disable Script Debugging disabled can become really obnoxious when you are browsing the web, so you might what to reable it when you don't need it.

Tags:

Comments

1.
waggi waggi United States says:

Great post.

2.
Terry bio Terry bio says:

I’m really very useful to follow a long-time see this as a blog here Thank you for your valuable information.

3.
Luigi Fulk Luigi Fulk United Kingdom says:

One of my favorite artists, thank you! A thoughtful insight and ideas I will use on my blog.

4.
Jessica Hometon Jessica Hometon United States says:

While this subject can be very touchy for most people, my opinion is that there has to be a middle or common ground that we all can find.  I do appreciate that you've added relevant and intelligent commentary here though.  Thank you!

5.
Jack G. Lushman Jack G. Lushman United States says:

What is the premium due for the long term care portion of the health reform bill?  I know it is called the Class Act, but you have to pay into it at I believe over $100.00 per month.  Any ideas?

6.
Franklin Pierce Franklin Pierce Ireland says:

I am genuinely impressed with the general content of your blog. It is easy to determine that you are fervent about your writing. If I had your writing ability, I know I would be successful. I have bookmarked your site and look forward to more updates.

7.
Sumner Sumner United Kingdom says:

I have enjoyed your blog, thank you,

8.
Manuela Benes Manuela Benes United States says:

Great post! Keep up the good work!

9.
Burton Haynes Burton Haynes says:

Thanks for sharing the link - but unfortunately it seems to be down? Does anybody have a mirror or another source?

10.
Marisha Sievert Marisha Sievert United Kingdom says:

Interesting article. I found myself in a money owing crisis paid to living beyond my means a few years ago and managed to acquire of out it through the make use of of a money owing consolidation specialist. They were very useful and helped me to place all my obligations into one loan which I could afford to pay back. This meant I became money owing free in specifically under 5 years. It was a brilliant feeling.

11.
Dorothy Boulanger Dorothy Boulanger United States says:

Great job! I would like to commend you for your good work on this entry. I hope you continue coming up with useful posts like this one.

12.
Teresa Norfleet Teresa Norfleet United States says:

The internet is cluttered with useless posts. This post of yours is an exception! Thank you for taking the time to share this.

13.
Peterson 	Peterson United Kingdom says:

interesting blog and nice design template?

14.
Robinson Robinson United States says:

Wonder full writing skills you got mate.

15.
Shawnda Rethman Shawnda Rethman United Kingdom says:

Pretty good post. I just stumbled upon your blog and wanted to say that I have really enjoyed reading your blog posts. Any way I'll be subscribing to your feed and I hope you post again soon.

16.
Claudia Claudia United States says:

I like your blog curently we are looking for a part time article writer would you be interested?

17.
Charise Clynes Charise Clynes United States says:

Wow! Just legendary! Your publishing manner is pleasing and the way you dealt the subject with grace is admirably. I am intrigued, I presume you are an expert on this topic. I am subscribing to your future updates from now on.

18.
Helen Woods Helen Woods Ireland says:

Hello, It is likely this posting might be off topic but anyhow, Having been surfing about your web site and it looks truly professional. It's obvious you know your subject and you seem fervent about it. I’m constructing a new blog plus I am attempting to make it look great, and offer high quality subject matter. I've discovered much at your website and I look forward to a lot more posts and will be back soon. Thanks you.

19.
Clayton Eisenhaver Clayton Eisenhaver People's Republic of China says:

hey, your post really helps, today i receive the same troubles, and i donot know how to figure out the problem. finanlly i look bing and discovered your post, it helps me get rid of my trouble.
thanks once morejust one thing, may i paste your article on my site? i will add the source and credit to your site.regards!

20.
Adam Adam United States says:

I admire the valuable information you offer in your articles. I will bookmark your blog and have my children check up here often. I am quite sure they will learn lots of new stuff here than anybody else!

21.
Graham Zecchini Graham Zecchini United Kingdom says:

I know this is really boring and you are skipping to the next comment, but I just wanted to throw you a big thanks - you cleared up some things for me!

22.
Shawn Bellanger Shawn Bellanger United Kingdom says:

I know this is really boring and you are skipping to the next comment, but I just wanted to throw you a big thanks - you cleared up some things for me!

23.
Sarai Sarai United States says:

Wonderful illustrated information. I thank you about that. No doubt it will be very useful for my future projects. Would like to see some other posts on the same subject!

24.
Salvador Balensiefen Salvador Balensiefen United States says:

Hi. I treasured to drop you a quick note to verbalize my thanks. I've been observing your blog for a month or so and have plucked up a heap of fabulous information as well as enjoyed the way you've structured your site. I am seeking to run my own blog however I think its too general and I would like to focus more on smaller topics.

Comments are closed