JScript Debugging in Visual Web Developer 2005

JScript Debugging in Visual Web Developer 2005

  • Comments 20

A lot of people have asked about how to debug JScript in Visual Web Developer 2005. You need to know a few tricks before you can set a breakpoint on an ASPX document (Note that the experience is vastly improved in our Orcas March CTP and I will be making a separate blog post on that soon).

 1. Enable client script debugging on IE:

 

2. Start debugging in Visual Web Developer (F5)

 

3. Bring up the Script Explorer window (Ctrl+Alt+N):

 

4. Once the Script Explorer window is opened, double click on the run-time document that you want to debug:

 

5. Now you can set a breakpoint in the run-time document:

 

The script execution will pause on the breakpoint when you execute the script. You can then examine objects at this point of the execution. For example, you can bring up the Quick Watch window and examine the data of the document object.

 

If you need to debug something during a page load, you can use the debugger statement:

 

Enjoy!

Barry Tang
Software Design Engineer
Visual Studio Web Tools

 

Leave a Comment
  • Please add 6 and 1 and type the answer here:
  • Post
  • There is no "Script Window" under the "Windows" tab. How do you activate the "Script Window"? Do you need to install any software first?

    Thanks,

  • Hi Barbara,

    There's no software needed, however you'll see the command appear once you're running your page (F5).  We'll update the blog instructions.

    Thanks,

    Jeff

  • There many and I mean MANY problems with script debugging inside VS. There is no solution to them as far as I have been able to tell after searchin the whole Internet back and forth.

    The main problem is that more often than not the Script Explorer will just be empty.

    No it's not the Script Explorer's fault. Even if you try to attach to an Internet Explorer process and have the html page opened and break points set, it still won't work. It is not a problem on my machine. I have seen it on different machines, on W2K, WXP, W2K3 on both VS 2003 and VS 2005.

    There IS a problem. Common solutions you can find on the internet just don't work. Sometimes a restart helps but not always. Sometimes it works once and then stops. Sometimes it doesn't work just to start working with no apparent reason!

    I have dropped this feature and use some crappy FireFox tools now. Yes they are crappy as can be, but at least they work!

    As for the Script Explorer window option not being there, try Ctrl + Alt + N

  • I use both the script explorer and the debugger; statement.  

    function debug()

    {

     debugger;

     ....

    }

    Using debugger along with enabling script debugging in the browser seems to work quite well.  Execution will stop at the debugger statement and then you can set break points and step through the code.

  • Jeff King made a recent post to show off the new JScript IntelliSense feature in the March CTP of Visual

  • When degugging is not working, even debugger; statement is not helping.

    I'm pretty sure that this is not a Visual Studio problem but rather Internet Explorer's.

  • Up until now, we've never had a great set of JavaScript debugging tools, but "Orcas", the next version

  • Internet Explorer should just be banned. It is beyond repair.

  • 摘自:http://blogs.msdn.com/webdevtools/archive/2007/03/08/jscript-debugging-in-visual-studio-2005.aspx...

  • A few weeks ago I blogged about the new JavaScript Intellisense support in VS 2008 . One of the other

  • A few weeks ago I blogged about the new JavaScript Intellisense support in VS 2008 . One of the other

  • A few weeks ago I blogged about the new JavaScript Intellisense support in VS 2008 . One of the other

  • In questo post Scott Guthrie illustra le nuove caratteristiche del debug di JavaScript in VS 2008 (anche

  • 摘要本期共有6篇文章:Ajax自动化测试以及调试工具列表VS2008的JavaScript调试功能Silverlight是什么?Silverlight资源、文章和教程LINQ到SQL—...

  • One of the other JavaScript features that I'm sure will be popular in VS 2008 is the much-improved support for JavaScript debugging. This is enabled in both the free Visual Web Developer 2008 Express edition as well as in Visual Studio, and makes using

Page 1 of 2 (20 items) 12