How to debug javascript in visual studio

Kudvenkat 2014-11-16

Views 3

debugging javascript in visual studio, debugging javascript, debugging javascript in ie, debug javascript, javascript tutorial

How to debug javascript in visual studio

In this video we will discuss, How to debug JavaScript in Visual Studio

Here are the steps
1. In Visual Studio, right click on a web form and select "Browse With..." option from the context menu

2. In the "Browse With" window,
a) select "Internet Explorer"
b) Click "Set as Default" button
c) Finally click "Browse" button

3. Close the internet explorer window that opens and run the visual studio project in Debug Mode.

4. In Visual Studio, throw a break point on the JavaScript function that you want to debug.

At this point, in the internet explorer perform the action (i.e clicking on button or changing a selection in the DropDownList) that calls the JavaScript function. The JavaScript execution should stop at the breakpoint and we should be able to step over and step into code using F10 and F11 keys respectively.

At this point we should also be able to use watch, quick watch and immediate windows in visual studio.

This approach will not work in visual studio 2008, if you are using any other browser apart from Internet Explorer.

Share This Video


Download

  
Report form