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).
Trackbacks
Trackback Address: 230/AC55A652915DE15CEF0427C9B31CC06E
Comments
On 02/22/2005 at 9:47:34 PM EST Bertrand Le Roy wrote:
1
Well, if you call things like ":TypeError - Undefined value" a useful error message... No line number, no source code, nothing useful really.
On 03/07/2005 at 11:29:58 AM EST jay wrote:
2
how about this:
(event handler):Undefined value
yeah, that's greatly helpful. Thanks Apple!
On 03/25/2005 at 1:33:51 PM EST scott wrote:
3
It seems like the Page Load Test and "Sample" files that Safari generates might be handy, but I can't find any information on how to use either of these capabilities that appear in the Debug menu.
Does anyone have any information on how these features work?
On 03/08/2006 at 9:55:38 PM EST Rich wrote:
4
I get "SyntaxError - Parse error Line 1". Really useful. </sarcasm>
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.
On 09/11/2006 at 9:15:44 AM EDT Jonathan wrote:
5
I actually enabled the debug menu via the Terminal. My JavaScript console displays error with the line number visible and when you double-click on the error it will launch the js file in source view and hightlight the line that is giving the error.
On 04/22/2007 at 4:57:28 PM EDT Charlie wrote:
6
I got NULL value error, and there is line number. It is really hard to debug in the case. I have been using Safari Enhancer
On 11/03/2008 at 6:17:55 PM EST davide wrote:
7
I also got a NULL value, only in Safari. It came from an Ajax empty xml tag. The value should be an empty string, not a null value...
On 11/14/2008 at 12:11:24 PM EST David wrote:
8
Does anybody know if one can debug using Windows Safari?
Regards,
Michael http://news.buzzyventure.com/0000/michael_bolton.htm
On 12/01/2009 at 11:17:13 AM EST Capra wrote:
9
To view the error console for Safari on a Mac, go into the Terminal application and issue this command (write it all on one line): defaults write com.apple.Safari IncludeDebugMenu 1
Post a Comment
Recent Entries
- Cache Template in Request Setting Explained
- What Version of Java is ColdFusion Using?
- ColdFusion 9 Performance Brief from Adobe
- Request Filtering in IIS 7 Howto
- J2EE Session Cookies on ColdFusion / JRun
- Hands on ColdFusion Security Training
- ColdFusion 9 Solr Vulnerability - Are you at Risk?
- FCKEditor Year 2010 Bug for Firefox 3.6 with ColdFusion
(event handler):Undefined value
yeah, that's greatly helpful. Thanks Apple!
Does anyone have any information on how these features work?
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.
Regards,
Michael http://news.buzzyventure.com/0000/michael_bolton.htm



add to del.icio.us



