» tagged pages
» logout
User:alex
Return to Tips and Tricks

Debugging Javascript in Safari

Make further edits, (or Cancel)

(or Cancel)

(Editing anonymously: to be credited for your changes, login or register a new account)

(or Cancel)

Tags Applied to this Entry

1 person has tagged this page:

There’s a hidden ‘cheat’ menu in Safari for debugging, and since Webkit has a ways to go in bringing JavaScript support up to par, this can be a very useful menu.

Probably of most use is ‘console.log’ – a Safari function that allows a Javascript developer to write to a log while debugging, instead of the all too common alert().

To enable the cheat menu, open a Terminal window and type:


defaults write com.apple.Safari IncludeDebugMenu 1

Restart Safari and you will see a new debug menu with all sorts of nifty tools including the console.log.

BTW you can also use console.log() in Firebug for Firefox, I’ve used it and it’s a really good tool.

Username:
Password:
(or Cancel)