Haven\'t touch javascript for 3 years. Just got a javascript project and wanted to know any new ways or tools emerged these years to debug javascript? I used alert 3 years
I realize I'm answering a question you didn't ask, but have you tried jQuery? It's a javascript library that abstracts a lot of the DOM manipulation stuff for you so you don't have to worry so much about cross-browser compatibility issues. There are other similar libraries out there, but I believe jQuery has the biggest following at the moment. http://jquery.com/
I use Firebug in Firefox every day. In addition to debugging Javascript (and by extension, jQuery or any other js library), it's a great for CSS debugging.
Dreamweaver as I write it and Firebug for more indepth debugging. alert()s are pretty useful too.
Aptana is a great dev platform that allows you to debug both FireFox and IE.
If you use Visual Studio, I highly recommend debugging with IE, despite what others say. When you hit a debugger
statement in IE and you have debugging enabled, you'll get a pop-up to start debugging in Visual Studio.
I don't like Firebug anymore, I don't know where it went wrong, but it's become highly unreliable (ignoring debugger
statements) and really can't compete with VS as far as debugging is concerned.
I argue to use build-in browser debugger for performance reason. Firefox and Chrome one are good enough.
They allow browse DOM, show dynamically generated sources, show network activity, profile JS, etc.
But don't miss printf
-approach with:
console.log("this is %o, event is %o, host is %s", this, e, location.host);
and:
console.log("%s", new Error().stack);
Use the Firebug extension for Firefox, or the built-in Web Inspector in any WebKit browser (Chrome or Safari). In IE8, you can use the built-in Developer ToolS.