Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Javascript Debugging in Visual Studio 2008

I'm trying to debug javascript code just by adding a breakpoint in VS2008, but the debugger's not stopping. Do I have to do some special setup in order to enable javascript debugging? Or does the code have to be in a separate js file?

like image 951
Raúl Roa Avatar asked Jan 11 '09 23:01

Raúl Roa


People also ask

How do I debug in Visual Studio 2008?

On the development computer, open the Visual Studio project to debug and in its Properties, go in Debugging and select Remote Windows Debugger as the Debugger to launch, put something similar to C:\Share\$(ProjectName).exe in Remote Command, C:\Share in Working Directory, the server name indicated on the Visual Studio ...

Is there a debugger for JavaScript?

But fortunately, all modern browsers have a built-in JavaScript debugger. Built-in debuggers can be turned on and off, forcing errors to be reported to the user. With a debugger, you can also set breakpoints (places where code execution can be stopped), and examine variables while the code is executing.

How do I debug JavaScript script?

We can open the console by pressing the F12 key or by clicking the right button and then selecting inspect. Javascript provides the keyword Debugger to debug the code.


1 Answers

Did you uncheck the checkboxes in the settings

Tools-->Internet Options-->Advanced-->Browsing [heading]-->Uncheck "Disable Script Debugging (Internet Explorer)" and Uncheck "Disable Script Debugging (Other)"

Sometimes you need to restart the browser to get VS2008 to recognize that it has made some changes.

Have you tried to stick the "debugger;" keyword into your JavaScript file? This usually never fails me.

If you have IE8, you can debug right in the browser itself.

like image 91
epascarello Avatar answered Sep 18 '22 05:09

epascarello