PDA

View Full Version : How can I debug javascript?


joelr
12-17-2002, 03:02 AM
I downloaded the Microsoft Javascript Debugger, or whatever it's called. I installed it, and it told me to restart. I was given the impression that it would alter IE's javascript error handling in some way to allow me to view the variables, step over, step in, step out, and such. But, it looks like nothing has changed in IE. Anyone else successfully gotten this MS debugger to work?

Bosko
12-17-2002, 03:14 PM
Don't waste your time on those Microsoft tools,IE sucks at JavaScript.Use Mozilla,which comes with a JavaScript console (displays detailed/precise information about the errors and warnings in your code) and a JavaScript debugger (stepping trough the code,watching variables etc.).Theres also the DOM inspector,which lets you view the current DOM tree of the page and all the properties of each node.
You can find these tools in the Tools>Web Development menu.

joelr
12-17-2002, 04:56 PM
I finally figured out how to use that silly Mozilla debugger. The UI is somewhat non-intuitive, but once I figured it out, I was able to plainly see what was wrong with my code. My code was setting the "visiblity" property rather than the "visibility" property. I wish there was some way to get warnings when setting non-existent properties of objects.

brothercake
12-17-2002, 05:58 PM
Remember though ... mozilla's debugger can only help you debug in Mozilla ...


IE does have built-in debugging; in the advanced options you check "Display a notification for every script error" and uncheck "Disable script debugging"

Bosko
12-18-2002, 03:26 PM
joelr,have you looked in the JavaScript console,it should show all errors/warnings (make sure to turn on Strict Warnings)?

brothercake,I suppose IE's debugger can debug code in Mozilla,Opera and Konqueror?
The JavaScript console/debugger are also 'built' in,all the errors/warnings are shown in the console,but you can choose what the debugger should do in case of an error in the debugger preferences.

basic3572002
12-24-2002, 11:15 AM
can you please help me, where did you download mozilla debuger.

i use the visual studio interdev version 6. its very hard it debuger wont works


thanks

Bosko
12-24-2002, 05:31 PM
Originally posted by basic3572002
can you please help me, where did you download mozilla debuger.

i use the visual studio interdev version 6. its very hard it debuger wont works


thanks
It comes with Mozilla => http://www.mozilla.org

whammy
12-26-2002, 03:42 AM
Ugh, that visual interdev debugger isn't even as helpful as using Netscape 4, regarding javascript... which is no surprise.

BTW, I quit using InterDev after about 2 weeks of learning ASP since I thought it was completely unwieldy as an IDE... I'm starting to think the same thing about ASP.NET and Visual Studio .NET as well... ;)

Are you an ASP programmer, or what? :)