Can't inspect or watch variable in Microsoft Script Debugger.

A

aramsey

I have a javascript program that works fine under Firefox and on IE
when running XP, but is having a problem with IE running under Windows
2000 Pro.

On my personal XP development machine I have the Microsoft Script
Editor and I can set a breakpoint, step through code, inspect
variables, etc... with no problem.

On a machine where I am trying to debug this problem I am running
Windows 2000 Pro with IE 6. I installed the Microsoft Script Debugger.
When the program hits the exception the script debugger will come up
and show me the line where the error occurred.

I need to be able to inspect the variables to determine the problem.
However, from what I can tell, there isn't anywhere to inspect or watch
the variables in MSD?

Am I missing something?

-alan
 
P

Patient Guy

I have a javascript program that works fine under Firefox and on IE
when running XP, but is having a problem with IE running under Windows
2000 Pro.

On my personal XP development machine I have the Microsoft Script
Editor and I can set a breakpoint, step through code, inspect
variables, etc... with no problem.

On a machine where I am trying to debug this problem I am running
Windows 2000 Pro with IE 6. I installed the Microsoft Script Debugger.
When the program hits the exception the script debugger will come up
and show me the line where the error occurred.

I need to be able to inspect the variables to determine the problem.
However, from what I can tell, there isn't anywhere to inspect or watch
the variables in MSD?

Am I missing something?

No, the MS Script Debugger is as useless and unimproved as IE 6, which has
been around eons. You can debug (monitor variables) through alerts or
inserting text in the browser content. But the debugger doesn't even name
the file (external JS file). MS doesn't seem particularly motivated to
improve its HTTP client; must be satisfied that a majority of PC users
will be using some form of IE rather than switch. Although the news says
that other browsers are gaining ground.

Don't take my word for it:

http://roho2003.blogspot.com/2005_12_01_roho2003_archive.html
http://smotricz.blogspot.com/2004_06_01_smotricz_archive.html
http://blogs.opensymphony.com/plightbo/2006/07/javascript_debugging_with_v
isu.html
 
A

aramsey

Okay, for anyone having similar problems. Here is what I have
discovered:

First, the "free" Microsoft script debugger is nearly useless. I will
show you the line where the program threw an exception. You can
inspect variables to a point. You can use the Command window to see if
variables are null or if the variable is a primitive type (number,
string, etc..), but you can't inspect any complex objects. I guess you
can also change the values, but that is about it. I didn't find any
good documentation for this from Microsoft (no surprise there) but the
following link helped out:

Debugging JavaScript in Your Applications:
http://www.codestore.net/store.nsf/unid/DOMT-5UBUVW?OpenDocument

Second, if you have access to Microsoft Frontpage you can optionally
install the Microsoft Script Editor (MSE). It is also available in
Visual Studio. This is actually a pretty nice debugger once its all
installed. I just think it should be either bundled with IE or
available for a free download.

Microsoft Script Editor:
http://erik.eae.net/archives/2005/07/04/21.49.50/

Third, another useful tool is the LumberJack logger. This is pretty
cool. You will need the prototype library as well, but it is a neat
way to add logging in a way similar to Log4j into your java script.
Beats the heck out of adding a bunch of "alert" statements, and will
even work on an end-user's machine without requiring them to install
additional software. It also works in both Firefox and IE.

LumberJack: http://gleepglop.com/javascripts/logger/

If you have read this far, I'll give you another couple of pieces of
advise on debugging javascript. I have found using a combination of
tools for both FireFox and IE seems to be the best approach. Both
systems have their advantages and disadvantages, but The following set
of tools seem to work pretty well when used in combination. I have
also found that, even though my company only "officially" supports IE,
my javascript is more stable if I build for BOTH IE and FireFox. It is
more work, but it pays off in the end.

First, for IE get the Microsoft Web Developers toolbar. It allows you
to inspect the entire DOM and has some useful tools like a ruler and
such...

Microsoft Web Developers Toolbar:

http://javascript.weblogsinc.com/2005/11/03/microsofts-developer-toolbar-for-ie/

For Firefox, you should get the Firebox debugger. It is the
counterpart to the Microsoft Script Editor.

Firebug:
https://addons.mozilla.org/firefox/1843/

Also use the FireFox DOM inspector:
FireFox DOM Inspector:
http://www.mozilla.org/projects/inspector/

Finally, in case you are interested, there is a slight difference
between how the 2000 version of Javascript was passing variables to
anoymous functions during an AJAX request call and the XP version.
Once I realized the problem it took me a very short amount of time to
fix. It tooks me a while to figure out the actual cause of the problem
because it was a couple of levels up the call stack and without a
descent debugger it took a lot of time to run down.

-alan
 
A

aramsey

Thanks to both Jim Davis and Patient Guy for your help. I appreciate
it very much.
-alan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,011
Latest member
AjaUqq1950

Latest Threads

Top