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