Welcome to MSDN Blogs Sign in | Join | Help

Visual Web Developer Team Blog

Your official information source from the Visual Web Developer team.

News

  • These postings are provided "AS IS" with no warranties, and confer no rights. Use of included code samples are subject to the terms specified Terms of Use
JScript Debugging in Visual Web Developer 2005

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

 

Posted: Thursday, March 08, 2007 10:56 PM by WebDevTools

Comments

Barbara said:

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,

# March 8, 2007 9:53 PM

WebDevTools said:

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

# March 8, 2007 10:04 PM

Michal Talaga said:

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

# March 9, 2007 3:27 AM

Ed said:

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.

# March 9, 2007 1:26 PM

Your Websites, Our Passion! said:

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

# March 9, 2007 6:35 PM

Michal Talaga said:

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.

# March 10, 2007 5:17 AM

PeteL's Blog said:

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

# March 13, 2007 9:20 PM

Michael Palmer said:

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

# March 27, 2007 11:40 AM

ScottGu's Blog said:

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

# July 20, 2007 2:29 AM

ASP.NET said:

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

# July 20, 2007 2:47 AM

BusinessRx Reading List said:

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

# July 20, 2007 2:57 AM

Blog di LucaB said:

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

# July 20, 2007 4:21 AM

Dflying Chen said:

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

# July 20, 2007 10:44 AM

TonyWang said:

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

# July 23, 2007 8:53 PM

拾荒时代 said:

VS2008JavaScriptDebugging AfewweeksagoIbloggedaboutthenewJavaScriptIntellisense...

# July 25, 2007 3:39 AM

Jacky_Xu said:

摘要

本期共有6篇文章: Ajax自动化测试以及调试工具列表

VS2008的JavaScript调试功能

Silverlight是什么?Silverlight资源、文章和教程

...

# December 17, 2007 8:52 PM

小舟侧盼千帆过,扬帆寻她千百度 said:

JavaScript

DebuggingandIntellisense,JavaScriptobfuscatoretcfromVS2005toVS2008

# January 14, 2008 9:35 AM

ProgrammingBookWorm said:

JScriptDebugginginVisualWebDeveloperOrcas

JeffKingmadearecentposttoshowoffthenewJ...

# January 14, 2008 8:30 PM
New Comments to this post are disabled
Page view tracker