Reputation: 15567
What techniques (other than alert(message);
) do you use to debug JavaScript/jQuery? Give particular attention to browser specific techniques.
console.log(message)
- alternative to alert(message);
(Nirmal)
Upvotes: 0
Views: 251
Reputation: 14775
The Chrome Developer Tools are a direct descendant of the Safari (WebKit) Developer Tools.
Upvotes: 1
Reputation: 62359
More in testing than debugging domain.
Selenium - for GUI tests
JSUnit - for unit testing
Upvotes: 1
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
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
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
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