Wednesday, October 12, 2005

I wrote some javascript code to fill a form selection box, and it worked in IE, Firefox, and Opera (!), but not on Safari. Safari doesn't display alerts or otherwise notify you of javascript errors, which makes it a lot harder to figure out what the problem is.

I searched around for a solution and found this: type defaults write com.apple.Safari IncludeDebugMenu 1 in a terminal window, and start Safari. You'll see a debug menu which contains a javascript console and other useful tools -- a user-agent switcher, bookmarks import/export, etc.

No comments: