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

Discussion in 'Javascript' started by aramsey@gmail.com, Oct 3, 2006.

  1. Guest

    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
     
    , Oct 3, 2006
    #1
    1. Advertising

  2. Patient Guy Guest

    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_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
     
    Patient Guy, Oct 3, 2006
    #2
    1. Advertising

  3. Guest

    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
     
    , Oct 4, 2006
    #3
  4. Guest

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

    Jim Davis wrote:
    > <> wrote in message
    > news:...
    > >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/Content/Development/JavaScript/Extensions/DP_Debug/
    >
    > I find it very useful, I hope youdo as well.
    >
    > Jim Davis
     
    , Oct 4, 2006
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Charles A. Lackman
    Replies:
    1
    Views:
    1,446
    smith
    Dec 8, 2004
  2. SpamProof
    Replies:
    0
    Views:
    642
    SpamProof
    Oct 21, 2003
  3. deluxstar
    Replies:
    5
    Views:
    890
    Terry Reedy
    Sep 25, 2010
  4. Bernie Schneider

    Using Debugger Watch Expressions

    Bernie Schneider, Jul 13, 2004, in forum: Perl Misc
    Replies:
    2
    Views:
    157
    Bernie Schneider
    Jul 14, 2004
  5. Robert Oschler
    Replies:
    1
    Views:
    246
    Mcginkel
    Sep 5, 2005
Loading...

Share This Page