JavaScript Debugging with Safari
If your doing web development or testing on Safari, JavaScript exceptions are quiet, like they are on most modern browsers (remember the days of annoying javascript error popups?). After looking around in the menus, or trying to type javascript:
in the location bar (this brings up the javascript console in mozilla) you will soon find that there is no way to see your JavaScript exceptions by default.
Safari does in-fact have some handy debugging tools for web developers (DOM Tree, User Agent Spoofing, etc), but they are all hidden and disabled by default. The easiest way to turn on the debugging menu in safari is by installing Safari Enhancer.
Make sure you check the box Debugging Menu
, you can see that there are also some other handy features in Safari Enhancer. Click Apply Lasting Setting
when your done.
Safari should reload and you will have a new menu called Debug
Check Log JavaScript Exceptions
in the debug menu. Now javascript exceptions will show up in your Console log (Applications / Utilities / Console
).
Like this? Follow me ↯
Tweet Follow @pfreitagJavaScript Debugging with Safari was first published on February 17, 2005.
Comments
(event handler):Undefined value
yeah, that's greatly helpful. Thanks Apple!
Considering that Safari's scripting support is pretty-much as non-standard as any other browser, they should really include decent debugging tools if they expect anyone to support their platform.
It came from an Ajax empty xml tag.
The value should be an empty string, not a null value...
defaults write com.apple.Safari IncludeDebugMenu 1
THOSE THINGS IN MY TERMINAL IT DOESN'T WORK THEN THE DEBUG MENU DOESN'T OPENS. I DON'T KNOW WHT TO DO.. HELP PLZ.. I WILL GET IN TROUBLE.. PLZZZZ