Are alert()'s the Javascript equivalent of Visual Studio IDE breakpoints?
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 fr开发者_运维问答om 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?
There are a couple of different solutions available.
- Firebug: http://getfirebug.com/doc/breakpoints/demo.html
- Venkman Debugger: https://developer.mozilla.org/en/using_breakpoints_in_venkman
- Aptana: http://docs.aptana.com/docs/index.php/Adding_a_breakpoint
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.
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.
精彩评论