How to debug JavaScript in Visual Studio


Follow these 2 simple steps and you will be debugging JavaScript with ease.

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.

- Dan Lewis

Comments (0)

Skip to main content