Fun Infused Games  |   Smooth Operator RSS 

  Home   |    Archive   |    Subscribe   |    Search   |    About
Posts prior to 8/2/2010 may be missing data. If you need one of those posts, please contact kriswd40@yahoo.com and I will try and recover/find it.

Easy JavaScript Debugging With Visual Studio
Date 6/13/2008    Tags Web, Visual Studio    (0)

A couple of days ago, I ranted on how difficult it was to debug JavaScript in your applications. I'm going to have to take that back though, I discovered something today that makes everything super simple.

First things is first, you must uncheck "Disable script debugging" from the Advanced tab in your Internet Options.

Then go into the JavaScript code that you'd like to debug and add the keyword "debugger" to where you want to start your debugging from.

Now when you run your application and your JavaScript is called, you'll get sent back into the Visual Studio debugger and you can step through code, set breakpoints, etc, just like you were debugging server-side code.

Another nice feature along with this debugging is that it brings up a view of how the source code for your page looks and makes it easy to check values of controls on the page. I can see this as hugely beneficial when it comes to creating customized AJAX applications.

I really wish I had known about this earlier, it would have saved me a ton of headaches. Hopefully this blog post will save others the pain I so needlessly endured. The issues I talked about in my previous blog still apply to trying to debug from IE, but using this method you debug right out of Visual Studio itself (I tested this on Visual Studio 2005, I can't say for certain which other versions it works on or if it works the same on them).

I should also credit the page where I found this info, which you can find right here. Thanks Steve! 0" style="disp


This article has been view 625 times.


Comments

No comments for this article.


Add Comments

Name *
Website
  Name the animal in the picture below:

*  
Comment *
Insert Cancel


Tags
ASP.net (18)  Fin (1)  Video Games (7)  Game Dev (11)  Abduction Action (1)  WP7 (8)  Visual Studio (1)  Hypership (28)  Advise (14)  C# (14)  FIN (20)  World of Chalk (2)  Absurd (2)  Abduction Action! (27)  Nasty (34)  PC (1)  Cool (2)  Sports (11)  Rant (50)  VolChaos (1)  Development (13)  Design (2)  Volchaos (11)  XNA (40)  Nastier (4)  Xbox (1)  iOS (3)  SQL (1)  XBLIG (32)  Trivia or Die (3)  Web (19)  Trivia Or Die (1)  Abdction Action! (1)