[Javascript] Debugger
liorean
liorean at f2o.org
Wed Nov 19 17:40:35 CST 2003
Hassan Schroeder wrote:
> Dave Stoltz wrote:
>> Ok, lets pretend that some people HATE Netscape, and don't even have it on
>> their machine....Now what should I use for Javascript debugging?
> Bummer. Then AFAIK you're stuck with the Microsoft Script Debugger
> that you apparently already have.
> Better than nothing, at least, which is what you get with Opera :-)
Netscape has always been nicer to the developer than ie when it comes to
scripting. It has reported the line number correctly, had more informing
error messages, and has had a debugger in two generations. Netscape's
successor, Mozilla, provides you with excellent script development
tools. You have the JavaScript console, the DOM Inspector, Venkman (the
JavaScript debugger), the ability to toggle strict warnings (will notify
you of potential problems wiht your code, and is - of course - stricter)
and a lot of extensions that allow your work to be done in far shorter
time. Microsoft has the Windows Script Debugger; of course, but that
only captures some kinds of errors, not all errors. The ie error reports
are often incorrect in line number, and are less informative over all.
Besides, the JScript engine allows far less insight into it's workings
than the other engines. (With the possible exception of KJS, but that at
least has a full from-the-source-code documentation, in the same way
Mozilla has.) Opera was dead silent about errors until op7, when a
JavaScript Consome appeard in it as well, and one that rivals the
Mozilla JavaScript Console in how informative it is at times. This
console is reachable from the menu, Window:Special:JavaScript Console.
Overall, I think you should use Mozilla as your primary debugging
platform because of it's clear superiority on this point. Opera is
helpfull, but when Mozilla doesn't give you the answer, op7 isn't likely
to help either. The Windows Script Debugger is useful for ie proprietary
code, but not for much else.
The best way to debug, though, is and always will be variable lookup by
alerts inserted in the source code, and knowing what JavaScript
constructs are supported to what level in what browsers.
Then there is JavaScript Lint, of course.
<http://www.crockford.com/javascript/jslint.html>
And if you need any documentation or references,
<http://www.codingforums.com/showthread.php?s=&threadid=17254>
HTH,
--
liorean <mailto:liorean at user.bip.net>
ViewStyles, ViewScripts, SwitchStyles and GraphicsInfo bookmarklets and
Theme Switcher, Cookies Handler scripts:
<http://liorean.web-graphics.com/>
More information about the Javascript
mailing list