Tuesday, March 14, 2006

VS2003: How to enable JavaScript debugging

Step 1:
The most forgotten step in enabling script debugging in VS 2003 is enabling the browser to debug scripts. You can find this option in Internet Explorer. Tools -> Internet Options…-> Advanced. You should disable the checkbox Disable script debugging.

Step 2:
Start your VS solution. After starting go to the page you want to debug. In VS go to Debug->Windows->Running documents. Here you see the documents that have been currently loaded in the Internet Explorer.
Open the document (in the running documents window) you want to debug and place a breakpoint.

When you refresh the page your code will stop at the breakpoint when the code passes.

If you have any problems, check to see if VS is set to debug scripts. Tools->Options…->Debugging->Just-In-Time->Script

No comments: