How can I debug JavaScript in Visual Studio?

To debug JavaScript in Visual Studio:

  1. Add the following line of code to your JavaScript:

    debugger;

  2. Open Internet Explorer, and from the main select Tools | Internet Options.... Deselect the following settings:

    • Disable Script Debugging (Internet Explorer)
    • Disable Script Debugging (Other)

  3. Restart Internet Explorer

  4. When your code runs the Visual Studio Just-In-Time Debugger displays. Select the correct version of Visual Studio for debugging and click Yes:



© (c) 2026 Oak Leaf Enterprises, Inc., 1996-2026 • Updated: 09/22/11
Comment or report problem with topic