Brad
Brad

Reputation: 15567

Tool Roundup for Debugging JavaScript

What techniques (other than alert(message);) do you use to debug JavaScript/jQuery? Give particular attention to browser specific techniques.

Tools

FireFox

Chrome

Safari

Opera

Internet Explorer (I had to put it last)

Upvotes: 0

Views: 251

Answers (7)

Brad
Brad

Reputation: 15567

Refer to question for roundup of all answers.

Upvotes: 0

James Sumners
James Sumners

Reputation: 14775

The Chrome Developer Tools are a direct descendant of the Safari (WebKit) Developer Tools.

Upvotes: 1

Mchl
Mchl

Reputation: 62359

More in testing than debugging domain.

Selenium - for GUI tests

JSUnit - for unit testing

Upvotes: 1

soslo
soslo

Reputation: 366

If you're concerned about using console.log because not all browsers support this, it's easy to workaround with a couple lines of javascript:

console = console || {};
console.log = console.log || function(){}; //you can change this to do whatever you want, or leave it to just keep js errors from being thrown

Upvotes: 2

Nirmal
Nirmal

Reputation: 9549

If you are looking for an alternative for alert(message);, it is console.log(message);

The requirement is that you need any modern browser or a browser with developer tools installed.

Upvotes: 1

Oli
Oli

Reputation: 1031

I love Blackbird. It's a cross-browser JS logging framework, with support for debug/info/warning/error.

You can display the console at any time with the F2 func key.

http://www.gscottolson.com/blackbirdjs/

Upvotes: 1

Nick Craver
Nick Craver

Reputation: 630349

console is your friend, available by default in newer browsers, and you can add a whole lot of debugging to IE with FireBug Lite.

For other browsers:

For demonstration/test cases, jsFiddle is also an excellent tool.

Upvotes: 3

Related Questions