2

I've notices I'm not capable to debug correctly js. I'm only using alert() as a spread sentences technique but I need something better. So... which tool do you use?

2

8 Answers 8

10

For Firefox Firebug it's the best, has a lot of useful features, the Console API is great, you can log, make assertions, profiling, timing and much more.

For IE, the Developer Tools of IE 8 is better than nothing, for earlier versions of IE, try the Developer Toolbar.

For Chrome and Safari, check the WebKit inspector and debugging tools.

7

In Firefox, Firebug and its console which provides a panel for debugging along with an object for programmatically evaluating inside of a script, eg

console.log('test')

Safari and the family of Webkit enhanced browsers have built-in inspectors/consoles.

Opera has Dragonfly.

There are several plugins for Internet Explorer, such as DebugBar and IE8 has a pretty neat built-in Developer Toolbar.

If you're on Linux you can even install spidermonkey-bin, which is the interpreter used by Firefox and invoke it with js in the console.

0
1

Chrome and IE8 have surprisingly good debugging consoles.

If you use Firefox, you'll need to install Firebug to compete.

1
  • Chrome and Safari share the Webkit debugging. They are getting better very quickly.
    – Nosredna
    Nov 21, 2009 at 19:19
1

For cross-browser logging you could use log4javascript.

1

Firebug is very good. However, if you are on Windows you should check out the Developer Tools in IE 8. The integrated debugger allows for breakpoints and uses a lot of great elements probably taken from Visual Studio concepts. You have an interactive console, etc. You can get to it using F12.

1
  • 1
    I work on Linux. Thanks anyway. Nov 21, 2009 at 19:30
1

Firebug lite is also good in a pinch

0

Firebug's a must. I've recently also started to use IE8's inner debugging tool and it's pretty nice as well.

0

To track down performance issues:

2
  • Is it a debugger, or an optimizer?
    – Nosredna
    Nov 21, 2009 at 19:30
  • well yeah, it's more a profiler - not a step debugger but it gives you traces which can be used for debugging purposes Nov 21, 2009 at 19:38

Not the answer you're looking for? Browse other questions tagged or ask your own question.