Welcome to MSDN Blogs Sign in | Join | Help

Scripting Debugging in Internet Explorer

I thought I’d take a couple minutes to talk about Script Debugging and Internet Explorer.

Script debugging is turned off by default you can enable it by going to:
Tools->Internet Options…->Advanced->Disable Script Debugging

Prior to XPSP2 the above will turn script debugging on for all applications that host the WebBrowser control (Outlook for example).

On XPSP2 we’ve split the option into two:
Tools->Internet Options…->Advanced->Disable Script Debugging (Internet Explorer)
Tools->Internet Options…->Advanced->Disable Script Debugging (Other)

When you’ve enabled Script Debugging ‘View->Script Debugger’ will now be present to help you break into the debugger.

The debugger statement can also be placed anywhere in your code to suspend execution this is similar to setting a breakpoint.
The Stop statement is the VBScript version of JScript’s debugger statement.

There are three applications which I’ve used for script debugging.  One is Visual Studio.Net, the second is Microsoft Script Debugger and the third is Microsoft Script Editor:

Miscrosoft Script Debugger:
You can obtain a copy of the Microsoft Script Debugger here:
http://www.microsoft.com/downloads/details.aspx?FamilyID=2f465be0-94fd-4569-b3c4-dffdf19ccd99&displaylang=en

The main MSDN page for using the Microsoft Script Debugger can be found here:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sdbug/Html/sdbug_1.asp

The Microsoft Script debugger allows you to debug client side and server side scripts and provides the same functionality as most debuggers do.

Directions on using the Microsoft Script debugger can be found here:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sdbug/Html/sdbug_2.asp

Microsoft Script Editor:
The Microsoft Script Editor comes free with Microsoft Office XP/2003 with FrontPage.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnfp2k2/html/odc_fpdebugscripts.asp
 
Visual Studio.net:
For Visual Studio.net debugging Monica Rosculet has written an excellent article on: Debugging Script Code Using Visual Studio.

Other:
Gregg Miskelly a developer on the Visual Studio team has posted some excellent information about: How Script Debugging Works.

-Phil Nachreiner
Published Tuesday, October 26, 2004 8:24 AM by ieblog

Comments

# re: Scripting Debugging in Internet Explorer

Tuesday, October 26, 2004 8:57 AM by Dave
Why is is that the 'debugger' statement doesn't always trigger something in the script engine. Sometimes the script engine will just ignore it. I've found that moving the statement around within a function can effect whether the debugger will get picked up. This has been going on since IE5 was released.

# re: Scripting Debugging in Internet Explorer

Tuesday, October 26, 2004 9:08 AM by Dave
I have to say, i find the script debugger in FireFox a lot easier to use whne trying to debug js

# re: Scripting Debugging in Internet Explorer

Tuesday, October 26, 2004 9:26 AM by minghong

# re: Scripting Debugging in Internet Explorer

Tuesday, October 26, 2004 10:42 AM by Phil Nachreiner [MSFT]
minghong, thanks. I've corrected the debugger statement link so that it now points to the the MSDN online library.

# re: Scripting Debugging in Internet Explorer

Tuesday, October 26, 2004 10:42 AM by Roger
The debugger feels far more 'integral' to Firefox. Like it or not, more clueless users are becoming power users. If the IE team tries to fight the transition, then they will lose, and this isn't even talking long-term. Empower your users!

# re: Scripting Debugging in Internet Explorer

Tuesday, October 26, 2004 10:46 AM by Phil Nachreiner [MSFT]
Dave, have you seen this behavior with the debugger statement with Script debugging turned on?

With Firefox are you using the Javascript Console or another plug-in debugger like: Venkman?

Thanks for your feedback :)

# re: Scripting Debugging in Internet Explorer

Tuesday, October 26, 2004 11:06 AM by Jason
I agree that IE could use something more simple and lightweight, like Firefox's Javascript Console. I've done work on sites where I made a simple error in the client-side scripting and IE would ask me if I want to start the debugger, I say yes, click OK about 6 times and then have the Script Debugger tell me it can't get the code to show me the problem. Of course I have no idea what's going on, because IE never gave me any clue about the error. Firefox will show a debugger-quality error message, complete with the offending line marked where the error occurred and its line number. In my opinion, Firefox simply has better usability in this area. I've used Venkman briefly for a few heavy javascript things, and it's amazing!

IE devs: The majority of people that care about this blog are web developers who want to see the next IE make their lives easier. Script debugging is yet another area where the competition has you beat. We want to see some innovation!

# re: Scripting Debugging in Internet Explorer

Tuesday, October 26, 2004 12:11 PM by José Sanchez
About debugging, I tried to switch off Javascript in IE 6 SP1 the other day, this was due to that we have to support IE because of the market share, otherwise we wouldnt care. But anyway, we disabled everything on all zones with no luck. Why does it have to be so difficult? Why not like Firefox or other browsers where you can easily uncheck the "enable Javascript" checkbox?

Also, due to several Javascrip errors i downloaded Microsoft Script debugger, sometimes when i got an error and it asked me to debug, it opened up the program and no code in the window, just a blank windows.

In Firefox, when you get a javascript error, you can click on it, and automatically it will hightlight the line where the error occured, doesnt matter if its an included js file or not.

Not to mention how to find out to acutally enable error reporting without restarting the browser... Really bad user experience for a web developer. Pitty

# re: Scripting Debugging in Internet Explorer

Tuesday, October 26, 2004 12:48 PM by I Hate It
Personnaly I nearly never need all the breakpoints and things. What I do often need are error messages that give real line numbers instead of some psuedo-random integer based on some internal version of the page thats inaccessible to me.

# re: Scripting Debugging in Internet Explorer

Tuesday, October 26, 2004 1:14 PM by Steve
"IE would ask me if I want to start the debugger, I say yes, click OK about 6 times and then have the Script Debugger tell me it can't get the code to show me the problem"

yeah, the script debugger gets severely confused when it comes to included javascript files..... makes debugging a royal pia

# re: Scripting Debugging in Internet Explorer

Wednesday, October 27, 2004 10:58 AM by a
last i checked, Netscape's javascript debugger was way better.

# re: Scripting Debugging in Internet Explorer

Thursday, October 28, 2004 11:51 AM by Dave
Phil, i'm just using the js console that comes with FireFox as standard. I will definatly try Venkman though.

What everyone else has said pretty much sums up my feelings. The ff js console is just so much quicker and easier.

# re: Scripting Debugging in Internet Explorer

Sunday, October 31, 2004 3:25 PM by Bryan
How on earth does one debug an ASP script?

I can't seem to get it to work as I think it should. I've got IIS 6 (win 2003) set to debug ASP server side. I've got script debugger installed. I run a script with a deliberate divide by zero error in it, and I get nothing. Just a normal error message in IE as always.

What am I missing!

# re: Scripting Debugging in Internet Explorer

Sunday, November 07, 2004 9:48 PM by Sootah
Make IE not ask to debug:
http://www.tweaksforgeeks.com/IEDebug.html

# re: Scripting Debugging in Internet Explorer

Wednesday, November 17, 2004 11:48 AM by Nicholas@pdsys.org
For the life of me I cannot get script debugging working after installing Web Developer Express. I've tried installing Microsoft Script Debugger again, and it will actually pop up when an error occurs, but the window is completely empty (no source loaded.)

I'm ripping my hair out. Any help would be appreciated.

# re: Scripting Debugging in Internet Explorer

Monday, November 22, 2004 6:29 AM by Jason
I am having the same problem as Nicholas. The debugger opens but it is blank. I am not running SP2. Could that be the problem?

# Scripting

Thursday, March 03, 2005 8:09 PM by IEBlog

# debugging javascript in ie

Saturday, February 04, 2006 3:44 PM by Gregor J. Rothfuss
if you ever have to debug javascript in internet explorer, you really want to go and download the free visual...

# Nio’s Weblog » JavaScript :: ????????? IE ????????????????????????

# ?????? » Blog Archive » links for 2006-04-08

Saturday, April 08, 2006 7:45 AM by ?????? » Blog Archive » links for 2006-04-08

# Zorched.Net » Blog Archive » JavaScript Toolkits

Saturday, April 29, 2006 12:09 AM by Zorched.Net » Blog Archive » JavaScript Toolkits

# Black Bird | Blog » Archivio » FireBug debugger

Thursday, May 25, 2006 3:09 PM by Black Bird | Blog » Archivio » FireBug debugger

# Werkzeuge für AJaX Entwickler

Saturday, May 27, 2006 9:22 AM by NETzWERKer, von Thomas Dreller
Microsoft-Entwickler wissen um die Vorzüge von ASP .NET, und einige der NETzWERK-Mitglieder haben sich...

# AJAX Experience & Tools

Monday, June 05, 2006 5:25 PM by IEBlog
Hi there!   My name is Laurel Reitman and I’m a Lead Program Manager on the Internet Explorer...

# Caiwangqin’s delicious bog » links for 2006-06-29

Thursday, June 29, 2006 7:22 PM by Caiwangqin’s delicious bog » links for 2006-06-29

# Debugging Client side script errors

Thursday, September 14, 2006 4:57 AM by Smartwombat Blog
I had a difficult problem with broadcasting powerpoint presentation. The tool I want to use can be found...

# Debugging JavaScript in Internet Explorer

Saturday, September 23, 2006 11:46 AM by christophe at vandeplas.com
From an IEBlog I've finally found how you can debug JavaScript ising Microsoft Internet Explorer. This article discusses the things you need to enable and install on your MS Windows machine.

Unfortunately I still don't understand why the script I use

# » JSLog, un logger ligero para javascript - Scriptia

Saturday, September 30, 2006 12:26 PM by » JSLog, un logger ligero para javascript - Scriptia

# Selenium Core FAQ

Tuesday, November 07, 2006 10:04 AM by Confluence: Selenium ??

Selenium Core FAQ This is an initial list of FAQs that have been collected for Selenium Core. We encourage people to add to this list and continue feedback on the items listed below: # (?) What is Selenium for?...

# links for 2006-11-10 « Stubblog

Friday, November 10, 2006 9:47 PM by links for 2006-11-10 « Stubblog

# Javascript debugging in Internet Explorer

Tuesday, November 21, 2006 12:39 PM by Javascript debugging in Internet Explorer

# wizardishungry/blog » When to use Google to solve your problems and when to solve things yourself

# JavaScript Debugging

Wednesday, January 10, 2007 5:00 PM by BuBlog

Γενικά βρίσκω πολύ χρήσιμο να κάνω debugging σε ότι φτιάχνω.. Πρόσφατα χρειάστηκε να φτιάξω κάτι σε JavaScript

# Designer Expert Chat Transcript (1/18/07)

Friday, January 19, 2007 2:02 AM by PeteL's Blog

We had a great chat today, thanks to everyone who came out, and to Chris, Markus, Alex and Dave who were

# Dare Obasanjo aka Carnage4Life - What Comes After AJAX?

Tuesday, March 06, 2007 10:12 AM by Dare Obasanjo aka Carnage4Life - What Comes After AJAX?

# IEでjavascriptのエラーをデバッグする方法

Monday, March 19, 2007 6:45 AM by bits and bytes

FirefoxであればFirebugで簡単に問題の場所をみつけられますが、IEでjavascriptのエラーが出ると、素っ気な...

# IE Developer Toolbar

Friday, April 20, 2007 11:14 AM by IE Developer Toolbar

# IE Developer Toolbar - ??????Blue

Monday, May 21, 2007 10:33 AM by IE Developer Toolbar - ??????Blue

# shinhee.kim | frontend engineer » JS debugging tools

# Debugging Javascript con Internet Explorer « Scrivere il titolo qui

# James Carr » Blog Archive » Dr.Strangescript or: How I Learned to Stop Worrying and Love IE

# JScript Debugger for IE at recurser

Thursday, July 26, 2007 11:10 PM by JScript Debugger for IE at recurser

# simpledream web studio: standards-based web design and development » Archives » Interesting Links for August 3–9, 2007

# klauskomenda.com » Debugging IE

Monday, August 20, 2007 5:41 AM by klauskomenda.com » Debugging IE

# ohio state university football stadium

Friday, September 07, 2007 1:11 PM by ohio state university football stadium

ohio state university football stadium

# Internet Explorer 7 Javascript Debugging | JarrodGoddard.com

# Par szo az IE debug funkciojarol « GerzSonka dolgai

Tuesday, December 18, 2007 3:20 AM by Par szo az IE debug funkciojarol « GerzSonka dolgai

# Zusammenh?ngender Quelltext f?r IE debugging - Seite 2 - XHTMLforum

# How-To: Debugging Javascript in IE with Microsoft Script Debugger | Ev's Tech Thought of the Day

# javascript ie und firefox - Forum Fachinformatiker.de

Wednesday, March 19, 2008 3:27 AM by javascript ie und firefox - Forum Fachinformatiker.de

# links for 2008-05-15 « Mike Does Tech

Wednesday, May 14, 2008 8:40 PM by links for 2008-05-15 « Mike Does Tech

# Debugging JavaScript, now in Opera « Michael Lauer’s Weblog

# allow scripts in internet explorer

Wednesday, June 11, 2008 12:56 AM by allow scripts in internet explorer

# Essential Tools for Tailoring CRM « Musings on Dynamics CRM

# programming help blogs ie

Saturday, July 05, 2008 5:53 AM by programming help blogs ie

# internet scripts

Wednesday, July 09, 2008 3:37 PM by internet scripts

# 进行 HTML、JavaScript 和 Ajax 开发和调试的必用工具

Thursday, July 31, 2008 12:18 PM by 上校

使用最好的开源工具处理Web页面、脚本和样式,简化新站点和页面的开发。动态检查和修改HTML标记、CSS和JavaScript,检查DOM以及客户机-服务器通信并了解bookmark...

# Internet Explorer 6 + Debug « Contemplation

Thursday, September 11, 2008 7:09 AM by Internet Explorer 6 + Debug « Contemplation

# Javascript debuggen | hilpers

Tuesday, January 20, 2009 9:22 AM by Javascript debuggen | hilpers

# Internet Explorer und immediateDescendants - php.de

Wednesday, January 21, 2009 2:12 PM by Internet Explorer und immediateDescendants - php.de

# Internet Explorer und immediateDescendants - php.de

Wednesday, January 21, 2009 2:12 PM by Internet Explorer und immediateDescendants - php.de

# debugger JS dla IE? | hilpers

Thursday, January 22, 2009 11:40 PM by debugger JS dla IE? | hilpers

# Debugging AJAX Applications with IE « Dark Views

Friday, January 30, 2009 10:52 AM by Debugging AJAX Applications with IE « Dark Views

# IEBlog Scripting Debugging in Internet Explorer | Paid Surveys

# IEBlog Scripting Debugging in Internet Explorer | Wood TV Stand

# IEBlog Scripting Debugging in Internet Explorer | Hair Growth Products

# IEBlog Scripting Debugging in Internet Explorer | debt consolidator

# IEBlog Scripting Debugging in Internet Explorer | work from home

New Comments to this post are disabled
 
Page view tracker