views:

36

answers:

3

I'm trying to find a less haphazard way than a write-and-test way to write Javascript. I don't really use an IDE - I write, then test in browser - if anything's wrong, I then use alert()'s to try tracing. This can be a tedious process having to go back and forth from Notepad++ to the browser, so I wonder if there are better ways of doing this, whether there's a good debug-friendly IDE for Javascript / jQuery or something better than alert's to use (dynamic tracing?).

Are alert()'s the Javascript equivalent of Visual Studio IDE breakpoints?

A: 

if you're using firefox, check out firebug. its not so much an ide as a slick debugging tool with a lot of extras.

also, if you're looking for something a little more portable, try blackbird.js one of the coolest little debugging tools i've seen, though nowhere near as frilly as firebugs it will work in any browser and provide your log messages and profiles with a visible place on the screen.

nathan gonzalez
does firebug track all variables, or just the ones you select in advance?
ina
it keeps track of the values, but will only display the ones you set up a watch for in the watch pane.
nathan gonzalez
+5  A: 

There are a couple of different solutions available.

WoLpH
+1 for actually linking the breakpoint functionality of each tool.
JGB146
A: 

Chrome and IE8 have built-in developer tools that you can use to debug JavaScript code. Firefox has a plug-in for that, too - called Firebug.

Fyodor Soikin