Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > Can't inspect or watch variable in Microsoft Script Debugger.

Reply
Thread Tools

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

 
 
aramsey@gmail.com
Guest
Posts: n/a
 
      10-03-2006
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

 
Reply With Quote
 
 
 
 
Patient Guy
Guest
Posts: n/a
 
      10-03-2006
http://www.velocityreviews.com/forums/(E-Mail Removed) wrote in comp.lang.javascript:

> 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...3_archive.html
http://smotricz.blogspot.com/2004_06...z_archive.html
http://blogs.opensymphony.com/plight...bugging_with_v
isu.html

 
Reply With Quote
 
 
 
 
aramsey@gmail.com
Guest
Posts: n/a
 
      10-04-2006
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/u...W?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/200...oolbar-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

 
Reply With Quote
 
aramsey@gmail.com
Guest
Posts: n/a
 
      10-04-2006
Thanks to both Jim Davis and Patient Guy for your help. I appreciate
it very much.
-alan

Jim Davis wrote:
> <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed) oups.com...
> >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.

>
> You can inspect variables using my debugger library but it won't let you do
> breakpoints or anything like that (there's no way to do that with plain
> vanilla javascript):
>
> http://www.depressedpress.com/Conten...ions/DP_Debug/
>
> I find it very useful, I hope youdo as well.
>
> Jim Davis


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
inspect.stack() or inspect.currentframe() gives "list index out ofrange error" deluxstar Python 5 09-25-2010 05:12 PM
microsoft.public.certification, microsoft.public.cert.exam.mcsa, microsoft.public.cert.exam.mcad, microsoft.public.cert.exam.mcse, microsoft.public.cert.exam.mcsd loyola MCSE 4 11-15-2006 02:40 AM
microsoft.public.certification, microsoft.public.cert.exam.mcsa, microsoft.public.cert.exam.mcad, microsoft.public.cert.exam.mcse, microsoft.public.cert.exam.mcsd loyola Microsoft Certification 3 11-14-2006 05:18 PM
microsoft.public.certification, microsoft.public.cert.exam.mcsa, microsoft.public.cert.exam.mcad, microsoft.public.cert.exam.mcse, microsoft.public.cert.exam.mcsd realexxams@yahoo.com Microsoft Certification 0 05-10-2006 02:35 PM
microsoft.public.dotnet.faqs,microsoft.public.dotnet.framework,microsoft.public.dotnet.framework.windowsforms,microsoft.public.dotnet.general,microsoft.public.dotnet.languages.vb Charles A. Lackman ASP .Net 1 12-08-2004 07:08 PM



Advertisments